mirror of
https://github.com/koloml/furbooru-tagging-assistant.git
synced 2025-12-24 07:12:57 +00:00
Getter for the type of the entity
This commit is contained in:
@@ -24,18 +24,22 @@ export default abstract class StorageEntity<SettingsType extends Object = {}> {
|
||||
return this.#settings;
|
||||
}
|
||||
|
||||
get type() {
|
||||
return (this.constructor as typeof StorageEntity)._entityName;
|
||||
}
|
||||
|
||||
public static readonly _entityName: keyof App.EntityNamesMap | "entity" = "entity";
|
||||
|
||||
async save() {
|
||||
await EntitiesController.updateEntity(
|
||||
(this.constructor as typeof StorageEntity)._entityName,
|
||||
this.type,
|
||||
this
|
||||
);
|
||||
}
|
||||
|
||||
async delete() {
|
||||
await EntitiesController.deleteEntity(
|
||||
(this.constructor as typeof StorageEntity)._entityName,
|
||||
this.type,
|
||||
this.id
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user