New view to see available editions from inventaire
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user