Archived
fix: floating bookmarks
- update floating bookmarks - fix search suggestions - fix filters
This commit is contained in:
@@ -44,15 +44,25 @@ export const booksApi = {
|
||||
},
|
||||
|
||||
async getGenres(): Promise<string[]> {
|
||||
const { data } = await api.get<string[]>("/books/genres/");
|
||||
const { data } = await api.get<string[]>("/books/ebooks/genres/");
|
||||
return data;
|
||||
},
|
||||
|
||||
async getAuthors(): Promise<string[]> {
|
||||
const { data } = await api.get<string[]>("/books/authors/");
|
||||
const { data } = await api.get<string[]>("/books/ebooks/authors/");
|
||||
return data;
|
||||
},
|
||||
|
||||
async searchEBooks(params: { q: string; page_size?: number }): Promise<EBookListItem[]> {
|
||||
const { data } = await api.get<{ count: number; results: EBookListItem[] } | EBookListItem[]>(
|
||||
"/books/ebooks/",
|
||||
{ params: { q: params.q.trim() } },
|
||||
);
|
||||
const items = Array.isArray(data) ? data : data.results ?? [];
|
||||
const limit = params.page_size ?? items.length;
|
||||
return items.slice(0, limit);
|
||||
},
|
||||
|
||||
async uploadEBook(
|
||||
file: File,
|
||||
title: string,
|
||||
|
||||
Reference in New Issue
Block a user