Updated from special database update syntax to DataFieldOperators

This commit is contained in:
WBHarry 2026-01-31 18:31:10 +01:00
parent 9553f3387f
commit cd52aa8f9c
25 changed files with 42 additions and 45 deletions

View file

@ -243,11 +243,11 @@ export function ActionMixin(Base) {
: foundry.utils.getProperty(result, basePath);
}
delete() {
async delete() {
if (!this.inCollection) return this.item;
const action = foundry.utils.getProperty(this.item, `system.${this.systemPath}`)?.get(this.id);
if (!action) return this.item;
this.item.update({ [`system.${this.systemPath}.-=${this.id}`]: null });
await this.item.update({ [`system.${this.systemPath}.${this.id}`]: _del }); // Does not work. Unsure why. It worked in v13 <_<'
this.constructor._sheets.get(this.uuid)?.close();
}