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:
@@ -41,7 +41,7 @@ export interface SyncedBookTools {
|
||||
}
|
||||
|
||||
export interface BookProps {
|
||||
id: string;
|
||||
bookId: string;
|
||||
type: string;
|
||||
authorId: string;
|
||||
title: string;
|
||||
@@ -190,7 +190,7 @@ export default class Book {
|
||||
return await Promise.all(
|
||||
books.map(async (book: BookQuery): Promise<BookProps> => {
|
||||
return {
|
||||
id: book.book_id,
|
||||
bookId: book.book_id,
|
||||
type: book.type,
|
||||
authorId: book.author_id,
|
||||
title: System.decryptDataWithUserKey(book.title, userKey),
|
||||
@@ -254,7 +254,7 @@ export default class Book {
|
||||
book.getBookInfos(userId);
|
||||
const bookTools: BookToolsTable | null = BookRepo.fetchBookTools(userId, bookId, lang);
|
||||
return {
|
||||
id: book.getId(),
|
||||
bookId: book.getId(),
|
||||
type: book.getType(),
|
||||
authorId: book.getAuthorId(),
|
||||
title: book.getTitle(),
|
||||
|
||||
Reference in New Issue
Block a user