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

@ -102,7 +102,7 @@ export default class BeastformSheet extends DHBaseItemSheet {
async advantageOnRemove(event) {
await this.document.update({
[`system.advantageOn.-=${event.detail.data.value}`]: null
[`system.advantageOn.${event.detail.data.value}`]: _del
});
}
}

View file

@ -108,8 +108,7 @@ export default class DhRollTableSheet extends foundry.applications.sheets.RollTa
getSystemFlagUpdate() {
const deleteUpdate = Object.keys(this.document._source.flags.daggerheart?.altFormula ?? {}).reduce(
(acc, formulaKey) => {
if (!this.daggerheartFlag.altFormula[formulaKey])
acc.altFormula[formulaKey] = foundry.data.operators.ForcedDeletion.create();
if (!this.daggerheartFlag.altFormula[formulaKey]) acc.altFormula[formulaKey] = _del;
return acc;
},
@ -129,7 +128,7 @@ export default class DhRollTableSheet extends foundry.applications.sheets.RollTa
static async #removeFormula(_event, target) {
await this.daggerheartFlag.updateSource({
[`altFormula.${target.dataset.key}`]: foundry.data.operators.ForcedDeletion.create()
[`altFormula.${target.dataset.key}`]: _del
});
this.render({ internalRefresh: true });
}