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:
@@ -2,6 +2,7 @@ import { getUserEncryptionKey } from "../keyManager.js";
|
||||
import System from "../System.js";
|
||||
import { ActChapter } from "./Act.js";
|
||||
import IncidentRepository, { IncidentQuery } from "../repositories/incident.repository.js";
|
||||
import RemovedItem from "./RemovedItem.js";
|
||||
|
||||
export interface IncidentStory {
|
||||
incidentTitle: string;
|
||||
@@ -91,6 +92,7 @@ export default class Incident {
|
||||
* @param userId - The unique identifier of the user
|
||||
* @param bookId - The unique identifier of the book
|
||||
* @param incidentId - The unique identifier of the incident to remove
|
||||
* @param deletedAt - The timestamp of deletion
|
||||
* @param lang - The language for error messages (defaults to 'fr')
|
||||
* @returns True if the incident was successfully deleted, false otherwise
|
||||
*/
|
||||
@@ -98,8 +100,13 @@ export default class Incident {
|
||||
userId: string,
|
||||
bookId: string,
|
||||
incidentId: string,
|
||||
deletedAt: number = System.timeStampInSeconds(),
|
||||
lang: 'fr' | 'en' = 'fr'
|
||||
): boolean {
|
||||
return IncidentRepository.deleteIncident(userId, bookId, incidentId, lang);
|
||||
const deleted: boolean = IncidentRepository.deleteIncident(userId, bookId, incidentId, lang);
|
||||
if (deleted) {
|
||||
RemovedItem.deleteTracker(userId, bookId, 'book_incidents', incidentId, deletedAt, lang);
|
||||
}
|
||||
return deleted;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user