From 11ee6e8b15e3ac2087b344927c882c4a5211fa5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Tue, 16 Feb 2021 12:50:12 +0100 Subject: [PATCH] change wording and remove console log --- packages/builder/src/builderStore/store/backend.js | 6 +++--- .../backend/DataTable/modals/CreateEditColumn.svelte | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/builderStore/store/backend.js b/packages/builder/src/builderStore/store/backend.js index 4192fc7cd0..cae1e9f2b4 100644 --- a/packages/builder/src/builderStore/store/backend.js +++ b/packages/builder/src/builderStore/store/backend.js @@ -234,9 +234,8 @@ export const getBackendUiStore = () => { return state }) }, - saveField: ({ originalName, field, primaryDisplay = false, indexes, relationshipType = 'many-to-many' }) => { + saveField: ({ originalName, field, primaryDisplay = false, indexes, relationshipType }) => { store.update(state => { - console.log(state) // delete the original if renaming // need to handle if the column had no name, empty string if (originalName || originalName === "") { @@ -251,7 +250,8 @@ export const getBackendUiStore = () => { if (primaryDisplay) { state.draftTable.primaryDisplay = field.name } - // Set one-to-many + + // Set relationship type if (field.type === 'link') { state.draftTable.relationshipType = relationshipType } diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 89f688e2d2..81b9274f36 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -60,7 +60,7 @@ originalName, field, primaryDisplay, - relationshipType: relationshipTypes.find(type => type.value === selectedRelationshipType), + relationshipType: relationshipTypes.find(type => type.text === selectedRelationshipType).value, indexes, }) return state @@ -200,7 +200,9 @@
{#each types as type} - + + + {/each}
@@ -232,6 +234,10 @@ title="Confirm Deletion" />