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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user