Refactor Book model and related components for consistent property naming

- Replaced `id` with `bookId` in `BookProps` and updated corresponding references.
- Added `tools` property to book-related components for tool management.
- Removed unused `books` property from `User` model.
- Added debug logs in `deleteBook` and `BookList` for troubleshooting.
This commit is contained in:
natreex
2026-01-15 17:22:59 -05:00
parent 3d4feaa680
commit ac968b7764
5 changed files with 7 additions and 12 deletions

View File

@@ -161,6 +161,7 @@ export default function BookList() {
const localBooks: BookProps[] = await window.electron.invoke<BookProps[]>('db:book:books');
bookResponse = localBooks.map((book: BookProps): BookProps & { itIsLocal: boolean } => ({ ...book, itIsLocal: true }));
}
console.log(bookResponse);
if (bookResponse) {
const booksByType: Record<string, BookProps[]> = bookResponse.reduce((groups: Record<string, BookProps[]>, book: BookProps): Record<string, BookProps[]> => {
const imageDataUrl: string = book.coverImage ? 'data:image/jpeg;base64,' + book.coverImage : '';
@@ -267,6 +268,7 @@ export default function BookList() {
localBook: localBookOnly,
coverImage: bookResponse?.coverImage ? 'data:image/jpeg;base64,' + bookResponse.coverImage : '',
quillsenseEnabled: bookResponse?.quillsenseEnabled,
tools: bookResponse?.tools,
});
}
} catch (e: unknown) {