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:
@@ -1,6 +1,7 @@
|
||||
import { getUserEncryptionKey } from "../keyManager.js";
|
||||
import System from "../System.js";
|
||||
import IssueRepository, { IssueQuery } from "../repositories/issue.repository.js";
|
||||
import RemovedItem from "./RemovedItem.js";
|
||||
|
||||
/**
|
||||
* Represents a synced issue with its metadata.
|
||||
@@ -84,15 +85,23 @@ export default class Issue {
|
||||
* Removes an issue from the database.
|
||||
*
|
||||
* @param userId - The unique identifier of the user.
|
||||
* @param bookId - The unique identifier of the book.
|
||||
* @param issueId - The unique identifier of the issue 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 issue was successfully removed, false otherwise.
|
||||
*/
|
||||
public static removeIssue(
|
||||
userId: string,
|
||||
bookId: string,
|
||||
issueId: string,
|
||||
deletedAt: number = System.timeStampInSeconds(),
|
||||
lang: 'fr' | 'en' = 'fr'
|
||||
): boolean {
|
||||
return IssueRepository.deleteIssue(userId, issueId, lang);
|
||||
const deleted: boolean = IssueRepository.deleteIssue(userId, issueId, lang);
|
||||
if (deleted) {
|
||||
RemovedItem.deleteTracker(userId, bookId, 'book_issues', issueId, deletedAt, lang);
|
||||
}
|
||||
return deleted;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user