Skip to content

Commit

Permalink
Fix relations lookup in m2m/m2a advanced edit existing (#9738)
Browse files Browse the repository at this point in the history
Fixes #9715
  • Loading branch information
rijkvanzanten committed Dec 1, 2021
1 parent 9feeb8c commit 291b52b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export const useFieldDetailStore = defineStore({
) as DeepPartial<Relation> | undefined;

if (['files', 'm2m', 'translations', 'm2a'].includes(this.localType)) {
this.relations.m2o = relations.find((relation) => relation !== this.relations.o2m) as
// These types rely on directus_relations fields being said, so meta should exist for these particular relations
this.relations.m2o = relations.find((relation) => relation.meta?.id !== this.relations.o2m?.meta?.id) as
| DeepPartial<Relation>
| undefined;
} else {
Expand Down

0 comments on commit 291b52b

Please sign in to comment.