Inventaire API: display search image

This commit is contained in:
2026-01-17 16:15:34 +01:00
parent a04aff6056
commit 8d3569e5d6
4 changed files with 25 additions and 10 deletions

View File

@@ -3,8 +3,13 @@ import { useAuthStore } from './auth.store.js'
const baseUrl = "http://localhost:8080"
export function getImagePathOrDefault(path) {
return (path == "" || typeof path === 'undefined') ?
"../defaultbook.png" : baseUrl + path;
if (path == "" || typeof path === 'undefined') {
return "../defaultbook.png";
} else if (path.startsWith("https://")) {
return path;
} else {
return baseUrl + path;
}
}
function useFetch(data, error, url) {