Author books API: use a single query with result and count

This commit is contained in:
2026-01-23 22:10:10 +01:00
parent 4ac0f4243d
commit cd2b8a93bb
6 changed files with 21 additions and 59 deletions

View File

@@ -17,7 +17,6 @@
let data = ref(null);
let error = ref(null);
let errorFetchTotal = ref(null);
const pageTotal = computed(() => {
let countValue = (data.value !== null) ? data.value['count'] : 0;
@@ -33,7 +32,6 @@
getSearchBooks(data, error, searchTerm, lang, limit, offset.value);
} else if (authorId != null) {
getAuthorBooks(data, error, authorId, limit, offset.value);
getCountAuthorBooks(totalBooksData, errorFetchTotal, searchTerm);
}
}

View File

@@ -51,10 +51,6 @@ export function getAuthorBooks(data, error, id, limit, offset) {
return useFetch(data, error, baseUrl + '/author/' + id + "/books" + "?" + queryParams.toString());
}
export function getCountAuthorBooks(data, error, id) {
return useFetch(data, error, baseUrl + '/author/' + id + "/books" + '/count');
}
export function getBook(data, error, id) {
return useFetch(data, error, baseUrl + '/book/' + id);
}