New view to see available editions from inventaire

This commit is contained in:
2026-01-28 19:10:19 +01:00
parent 2250304bf0
commit f444cbb19f
13 changed files with 507 additions and 5 deletions

View File

@@ -2,9 +2,17 @@ import { useAuthStore } from './auth.store.js'
const baseUrl = "http://localhost:8080"
export function getInventaireImagePathOrDefault(path) {
return getImagePathOrGivenDefault(path, "../../defaultinventairebook.png")
}
export function getImagePathOrDefault(path) {
return getImagePathOrGivenDefault(path, "../defaultbook.png")
}
export function getImagePathOrGivenDefault(path, defaultpath) {
if (path == "" || typeof path === 'undefined') {
return "../defaultbook.png";
return defaultpath;
} else if (path.startsWith("https://")) {
return path;
} else {
@@ -38,6 +46,11 @@ export function getSearchBooks(data, error, searchterm, lang, limit, offset) {
return useFetch(data, error, baseUrl + '/search/' + encodeURIComponent(searchterm) + "?" + queryParams.toString());
}
export function getInventaireEditionBooks(data, error, inventaireId, lang, limit, offset) {
const queryParams = new URLSearchParams({lang: lang, limit: limit, offset: offset});
return useFetch(data, error, baseUrl + '/inventaire/books/' + encodeURIComponent(inventaireId) + "?" + queryParams.toString());
}
export function getAuthor(data, error, id) {
return useFetch(data, error, baseUrl + '/author/' + id);
}