Refactor IPC handlers to enforce consistent return types and enhance type definitions
- Update return types for IPC handlers in `character.ipc.ts`, `chapter.ipc.ts`, and `location.ipc.ts` for stricter type safety. - Introduce new type definitions for better structure and clarity. - Remove redundant console logs and unnecessary comments for cleaner code.
This commit is contained in:
@@ -47,8 +47,8 @@ ipcMain.handle('db:character:attribute:add', createHandler<AddAttributeData, str
|
||||
);
|
||||
|
||||
// DELETE /character/attribute/delete - Delete character attribute
|
||||
ipcMain.handle('db:character:attribute:delete', createHandler<string, any>(
|
||||
function(userId: string, attributeId: string, lang: 'fr' | 'en') {
|
||||
ipcMain.handle('db:character:attribute:delete', createHandler<string, boolean>(
|
||||
function(userId: string, attributeId: string, lang: 'fr' | 'en'): boolean {
|
||||
return Character.deleteAttribute(userId, attributeId, lang);
|
||||
}
|
||||
)
|
||||
@@ -60,6 +60,4 @@ ipcMain.handle('db:character:update', createHandler<CharacterPropsPost, boolean>
|
||||
return Character.updateCharacter(userId, character, lang);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
console.log('[IPC] Character handlers registered');
|
||||
);
|
||||
Reference in New Issue
Block a user