add change set to mutator insert/update after event

This commit is contained in:
dswbx
2025-03-21 19:32:24 +01:00
parent 9380091ba9
commit 67e0374c04
3 changed files with 16 additions and 4 deletions

View File

@@ -167,7 +167,9 @@ export class Mutator<
const res = await this.single(query);
await this.emgr.emit(new Mutator.Events.MutatorInsertAfter({ entity, data: res.data }));
await this.emgr.emit(
new Mutator.Events.MutatorInsertAfter({ entity, data: res.data, changed: validatedData }),
);
return res as any;
}
@@ -198,7 +200,12 @@ export class Mutator<
const res = await this.single(query);
await this.emgr.emit(
new Mutator.Events.MutatorUpdateAfter({ entity, entityId: id, data: res.data }),
new Mutator.Events.MutatorUpdateAfter({
entity,
entityId: id,
data: res.data,
changed: validatedData,
}),
);
return res as any;