fix loading wrong relations (#4876)

This commit is contained in:
Nitwel
2021-04-07 17:43:53 +02:00
committed by GitHub
parent bda9934867
commit f4d9234024

View File

@@ -52,7 +52,10 @@ export const useRelationsStore = createStore({
}
const relations: Relation[] = this.getRelationsForCollection(collection).filter((relation: Relation) => {
return relation.many_field === field || relation.one_field === field;
return (
(relation.many_collection === collection && relation.many_field === field) ||
(relation.one_collection === collection && relation.one_field === field)
);
});
if (relations.length > 0) {