Remove CharacterComponent and CharacterDetail components
- Deleted `CharacterComponent` and `CharacterDetail` files from the project. - Refactored related logic to improve code maintainability and reduce redundancy.
This commit is contained in:
@@ -270,11 +270,12 @@ ipcMain.handle(
|
||||
interface RemoveIncidentData {
|
||||
bookId: string;
|
||||
incidentId: string;
|
||||
deletedAt: number;
|
||||
}
|
||||
|
||||
ipcMain.handle('db:book:incident:remove', createHandler<RemoveIncidentData, boolean>(
|
||||
function(userId: string, data: RemoveIncidentData, lang: 'fr' | 'en') {
|
||||
return Incident.removeIncident(userId, data.bookId, data.incidentId, lang);
|
||||
return Incident.removeIncident(userId, data.bookId, data.incidentId, data.deletedAt, lang);
|
||||
}
|
||||
)
|
||||
);
|
||||
@@ -297,12 +298,14 @@ ipcMain.handle('db:book:plot:add', createHandler<AddPlotPointData, string>(
|
||||
// DELETE /book/plot/remove - Remove plot point
|
||||
interface RemovePlotData {
|
||||
plotId: string;
|
||||
bookId: string;
|
||||
deletedAt: number;
|
||||
}
|
||||
ipcMain.handle(
|
||||
'db:book:plot:remove',
|
||||
createHandler<RemovePlotData, boolean>(
|
||||
function(userId: string, data: RemovePlotData, lang: 'fr' | 'en') {
|
||||
return PlotPoint.removePlotPoint(userId, data.plotId, lang);
|
||||
return PlotPoint.removePlotPoint(userId, data.bookId, data.plotId, data.deletedAt, lang);
|
||||
}
|
||||
)
|
||||
);
|
||||
@@ -319,10 +322,11 @@ ipcMain.handle('db:book:issue:add', createHandler<AddIssueData, string>(
|
||||
interface RemoveIssueData {
|
||||
bookId: string;
|
||||
issueId: string;
|
||||
deletedAt: number;
|
||||
}
|
||||
ipcMain.handle('db:book:issue:remove', createHandler<RemoveIssueData, boolean>(
|
||||
function(userId: string, data: RemoveIssueData, lang: 'fr' | 'en') {
|
||||
return Issue.removeIssue(userId, data.issueId, lang);
|
||||
return Issue.removeIssue(userId, data.bookId, data.issueId, data.deletedAt, lang);
|
||||
}
|
||||
)
|
||||
);
|
||||
@@ -363,10 +367,12 @@ ipcMain.handle('db:book:world:element:add', createHandler<AddWorldElementData, s
|
||||
// DELETE /book/world/element/delete - Remove element from world
|
||||
interface RemoveWorldElementData {
|
||||
elementId: string;
|
||||
bookId: string;
|
||||
deletedAt: number;
|
||||
}
|
||||
ipcMain.handle('db:book:world:element:remove', createHandler<RemoveWorldElementData, boolean>(
|
||||
function(userId: string, data: RemoveWorldElementData, lang: 'fr' | 'en') {
|
||||
return World.removeElementFromWorld(userId, data.elementId, lang);
|
||||
return World.removeElementFromWorld(userId, data.bookId, data.elementId, data.deletedAt, lang);
|
||||
}
|
||||
)
|
||||
);
|
||||
@@ -374,10 +380,11 @@ ipcMain.handle('db:book:world:element:remove', createHandler<RemoveWorldElementD
|
||||
// DELETE /book/delete - Delete book
|
||||
interface DeleteBookData {
|
||||
id: string;
|
||||
deletedAt: number;
|
||||
}
|
||||
ipcMain.handle('db:book:delete', createHandler<DeleteBookData, boolean>(
|
||||
function(userId: string, data: DeleteBookData, lang: 'fr' | 'en') {
|
||||
return Book.removeBook(userId, data.id, lang);
|
||||
return Book.removeBook(userId, data.id, data.deletedAt, lang);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user