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 PlotPointRepository, { PlotPointQuery } from "../repositories/plotpoint.repository.js";
import RemovedItem from "./RemovedItem.js";
export interface PlotPointStory {
plotTitle: string;
@@ -96,11 +97,17 @@ export default class PlotPoint {
/**
* Removes a plot point from the database.
* @param userId - The unique identifier of the user
* @param bookId - The unique identifier of the book
* @param plotId - The unique identifier of the plot point to remove
* @param deletedAt - The timestamp of deletion
* @param lang - The language for error messages ('fr' or 'en'), defaults to 'fr'
* @returns True if the plot point was successfully deleted, false otherwise
*/
static removePlotPoint(userId: string, plotId: string, lang: 'fr' | 'en' = 'fr'): boolean {
return PlotPointRepository.deletePlotPoint(userId, plotId, lang);
static removePlotPoint(userId: string, bookId: string, plotId: string, deletedAt: number = System.timeStampInSeconds(), lang: 'fr' | 'en' = 'fr'): boolean {
const deleted: boolean = PlotPointRepository.deletePlotPoint(userId, plotId, lang);
if (deleted) {
RemovedItem.deleteTracker(userId, bookId, 'book_plot_points', plotId, deletedAt, lang);
}
return deleted;
}
}