Fix relations lookup in m2m/m2a advanced edit existing (#9738)

Fixes #9715
This commit is contained in:
Rijk van Zanten
2021-11-11 15:32:11 -05:00
committed by GitHub
parent 776615bf66
commit 23752f622a

View File

@@ -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 {