Tweak the embedded item updating method to make it retrieve the value correctly
This commit is contained in:
parent
6700c8c1fb
commit
9a61b9f127
2 changed files with 13 additions and 12 deletions
|
|
@ -31,8 +31,19 @@ export class ActorHandler extends Actor {
|
|||
};
|
||||
|
||||
async genericEmbeddedUpdate($event) {
|
||||
if (!this.fn?.genericEmbeddedUpdate) return;
|
||||
this.fn.genericEmbeddedUpdate.bind(this)($event);
|
||||
if (this.fn?.genericEmbeddedUpdate) {
|
||||
return this.fn.genericEmbeddedUpdate.bind(this)($event);
|
||||
};
|
||||
const target = $event.delegateTarget;
|
||||
const data = target.dataset;
|
||||
const item = await fromUuid(data.embeddedId);
|
||||
|
||||
let value = target.value;
|
||||
switch (target.type) {
|
||||
case "checkbox": value = target.checked; break;
|
||||
};
|
||||
|
||||
await item?.update({ [data.embeddedUpdate]: value });
|
||||
};
|
||||
|
||||
async genericEmbeddedDelete($event) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue