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 SeriesSpellRepo, { SeriesSpellResult, SeriesSpellTagResult } from "../repositories/series-spell.repo.js";
|
||||
import RemovedItem from "./RemovedItem.js";
|
||||
|
||||
export interface SeriesSpellTagProps {
|
||||
id: string;
|
||||
@@ -155,11 +156,16 @@ export default class SeriesSpell {
|
||||
* Deletes a spell.
|
||||
* @param userId - The unique identifier of the user
|
||||
* @param spellId - The unique identifier of the spell
|
||||
* @param deletedAt - The timestamp of deletion
|
||||
* @param lang - The language for error messages ('fr' or 'en')
|
||||
* @returns True if successful
|
||||
*/
|
||||
public static deleteSpell(userId: string, spellId: string, lang: 'fr' | 'en' = 'fr'): boolean {
|
||||
return SeriesSpellRepo.deleteSpell(userId, spellId, lang);
|
||||
public static deleteSpell(userId: string, spellId: string, deletedAt: number = System.timeStampInSeconds(), lang: 'fr' | 'en' = 'fr'): boolean {
|
||||
const deleted: boolean = SeriesSpellRepo.deleteSpell(userId, spellId, lang);
|
||||
if (deleted) {
|
||||
RemovedItem.deleteTracker(userId, null, 'series_spells', spellId, deletedAt, lang);
|
||||
}
|
||||
return deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -202,10 +208,15 @@ export default class SeriesSpell {
|
||||
* Deletes a tag.
|
||||
* @param userId - The unique identifier of the user
|
||||
* @param tagId - The unique identifier of the tag
|
||||
* @param deletedAt - The timestamp of deletion
|
||||
* @param lang - The language for error messages ('fr' or 'en')
|
||||
* @returns True if successful
|
||||
*/
|
||||
public static deleteTag(userId: string, tagId: string, lang: 'fr' | 'en' = 'fr'): boolean {
|
||||
return SeriesSpellRepo.deleteTag(userId, tagId, lang);
|
||||
public static deleteTag(userId: string, tagId: string, deletedAt: number = System.timeStampInSeconds(), lang: 'fr' | 'en' = 'fr'): boolean {
|
||||
const deleted: boolean = SeriesSpellRepo.deleteTag(userId, tagId, lang);
|
||||
if (deleted) {
|
||||
RemovedItem.deleteTracker(userId, null, 'series_spell_tags', tagId, deletedAt, lang);
|
||||
}
|
||||
return deleted;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user