fix: floating bookmarks

- update floating bookmarks
- fix search suggestions
- fix filters
This commit is contained in:
2026-06-03 22:33:24 -05:00
parent 054e7689bd
commit d9c66e68a6
11 changed files with 296 additions and 75 deletions
+12 -2
View File
@@ -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,