Introduce series management functionality and repository updates
- Added `series-world.repo.ts` to handle database operations related to series worlds and their elements. - Implemented `series-sync.repo.ts` for managing synchronization between books and series. - Expanded `spell.ipc.ts` data models to include `seriesSpellId` for spell synchronization. - Refactored `insertSpellTag` method in `spelltag.repo.ts` for improved error handling and logic clarity.
This commit is contained in:
@@ -82,6 +82,7 @@ interface AddWorldData {
|
||||
bookId: string;
|
||||
worldName: string;
|
||||
id?: string;
|
||||
seriesWorldId?: string | null;
|
||||
}
|
||||
|
||||
interface AddWorldElementData {
|
||||
@@ -113,7 +114,7 @@ interface UpdateWorldData {
|
||||
|
||||
interface UpdateBookToolData {
|
||||
bookId: string;
|
||||
toolName: 'characters' | 'worlds' | 'locations';
|
||||
toolName: 'characters' | 'worlds' | 'locations' | 'spells';
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
@@ -340,7 +341,7 @@ ipcMain.handle('db:book:worlds:get', createHandler<GetWorldsData, WorldListRespo
|
||||
// POST /book/world/add - Add world
|
||||
ipcMain.handle('db:book:world:add', createHandler<AddWorldData, string>(
|
||||
function(userId: string, data: AddWorldData, lang: 'fr' | 'en') {
|
||||
return World.addNewWorld(userId, data.bookId, data.worldName, lang, data.id);
|
||||
return World.addNewWorld(userId, data.bookId, data.worldName, lang, data.id, data.seriesWorldId || null);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user