Add multi-language support and new repository methods for book synchronization
- Extend repository methods to handle API requests for fetching books, chapters, characters, and other entities with multilingual support (`lang: 'fr' | 'en'`). - Add `uploadBookForSync` logic to consolidate and decrypt book data for synchronization. - Refactor schema migration logic to remove console logs and streamline table recreation. - Enhance error handling across database repositories and IPC methods.
This commit is contained in:
@@ -117,7 +117,15 @@ ipcMain.handle('db:book:syncSave', createHandler<CompleteBook, boolean>(
|
||||
// GET /book/:id - Get single book
|
||||
ipcMain.handle('db:book:bookBasicInformation', createHandler<string, BookProps>(
|
||||
async function(userId: string, bookId: string, lang: 'fr' | 'en'):Promise<BookProps> {
|
||||
return await Book.getBook(userId, bookId);
|
||||
return await Book.getBook(userId, bookId, lang);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
// GET
|
||||
ipcMain.handle('db:book:uploadToServer', createHandler<string, CompleteBook>(
|
||||
async function(userId: string, bookId: string, lang: 'fr' | 'en'):Promise<CompleteBook> {
|
||||
return await Book.uploadBookForSync(userId, bookId, lang);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user