Author books API: use a single query with result and count
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user