From 50e571c1de3e86a156589223537ee935f599687c Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 19 Jan 2023 14:29:47 +0000 Subject: [PATCH] Ignore primary touched if isMany --- .../backend/Datasources/CreateEditRelationship.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index d2f707a6e0..2000d45dde 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -95,7 +95,7 @@ if ($touched.toCol && !fromRelate.name) { errObj.toCol = colNotSet } - if ($touched.primary && !fromPrimary) { + if ($touched.primary && !isMany && !fromPrimary) { errObj.primary = "Please pick the primary key" } // currently don't support relationships back onto the table itself, needs to relate out @@ -152,6 +152,8 @@ Object.keys($touched).length !== 0 && fromTable && toTable + + $: console.log("Errors ", errors) $: linkTable = through || toTable $: relationshipTypes = [ {