From d7ae20ce2193498827d5039bbb1273ca50b3f4dd Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 13 Jan 2023 12:41:41 +0000 Subject: [PATCH] Use foreign key instead of parimary[0] --- .../backend/Datasources/CreateEditRelationship.svelte | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index d83f3bf9a7..74bba33baa 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -127,10 +127,7 @@ let fromPrimary $: { if (!fromPrimary && fromTable) { - const relationshipKey = fromRelationship?.fieldName - fromPrimary = - fromTable.primary.filter(val => val === relationshipKey)[0] || - fromTable.primary[0] + fromPrimary = fromRelationship?.foreignKey } } $: isManyToMany =