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:
natreex
2026-02-05 14:12:08 -05:00
parent cec5830360
commit 209dc6f85a
133 changed files with 17673 additions and 3110 deletions

View File

@@ -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;
}
}