Skip to content

Commit

Permalink
fix(api): use payload updated with filter event for O2M processing (d…
Browse files Browse the repository at this point in the history
…irectus#20926)

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
  • Loading branch information
mahendraHegde and paescuj authored Jan 10, 2024
1 parent a089e8b commit 23da253
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-socks-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@directus/api': patch
---

Enabled updates of O2M entities via filter hook on parent level, ensured the payload of update action event reflects the actual updated value
4 changes: 2 additions & 2 deletions api/src/services/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ export class ItemsService<Item extends AnyItem = AnyItem> implements AbstractSer

for (const key of keys) {
const { revisions, nestedActionEvents: nestedActionEventsO2M } = await payloadService.processO2M(
payload,
payloadWithA2O,
key,
opts,
);
Expand Down Expand Up @@ -774,7 +774,7 @@ export class ItemsService<Item extends AnyItem = AnyItem> implements AbstractSer
? ['items.update', `${this.collection}.items.update`]
: `${this.eventScope}.update`,
meta: {
payload,
payload: payloadWithPresets,
keys,
collection: this.collection,
},
Expand Down

0 comments on commit 23da253

Please sign in to comment.