From 0f5e91b645db1c7a96dee288d2f07955d7b339af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Mon, 15 Feb 2021 17:37:07 +0100 Subject: [PATCH] fix not being able to select relationship type --- .../backend/DataTable/modals/CreateEditColumn.svelte | 10 +++++----- .../src/components/common/LinkedRowSelector.svelte | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 96385d62ca..89f688e2d2 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -38,9 +38,9 @@ {text: 'Many to many (N:N)', value: 'many-to-many',}, {text: 'One to many (1:N)', value: 'one-to-many',} ] - let relationshipType = 'many-to-many'; + let types = ['Many to many (N:N)', 'One to many (1:N)'] - $: console.log(relationshipType) + let selectedRelationshipType = 'Many to many (N:N)' let indexes = [...($backendUiStore.selectedTable.indexes || [])] let confirmDeleteDialog @@ -60,7 +60,7 @@ originalName, field, primaryDisplay, - relationshipType, + relationshipType: relationshipTypes.find(type => type.value === selectedRelationshipType), indexes, }) return state @@ -199,8 +199,8 @@
- {#each relationshipTypes as {text, value}} - + {#each types as type} + {/each}
diff --git a/packages/builder/src/components/common/LinkedRowSelector.svelte b/packages/builder/src/components/common/LinkedRowSelector.svelte index 8f7e73c9d5..9ac52896fb 100644 --- a/packages/builder/src/components/common/LinkedRowSelector.svelte +++ b/packages/builder/src/components/common/LinkedRowSelector.svelte @@ -31,6 +31,8 @@ function getPrettyName(row) { return row[linkedTable.primaryDisplay || "_id"] } + + $: console.log(schema.relationshipType) {#if linkedTable.primaryDisplay == null}