From e3e8b538f5c9c1204033b9f2b2ea2bda26732836 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 24 Nov 2021 13:15:44 +0000 Subject: [PATCH] Review comments. --- .../backend/Datasources/CreateEditRelationship.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index 8b984b5dea..104fd7cb5a 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -98,12 +98,16 @@ return errors } + let fromPrimary + $: { + if (!fromPrimary && fromTable) { + fromPrimary = fromTable.primary[0] + } + } $: isManyToMany = fromRelationship?.relationshipType === RelationshipTypes.MANY_TO_MANY $: isManyToOne = fromRelationship?.relationshipType === RelationshipTypes.MANY_TO_ONE - $: fromPrimary = - !fromPrimary && fromTable ? fromTable.primary[0] : fromPrimary $: tableOptions = plusTables.map(table => ({ label: table.name, value: table._id,