From 3d853677bdfe730e3dc469d54bc69b8b9b9fec9e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 20 Aug 2020 15:49:18 +0100 Subject: [PATCH] fix bug with changing types --- .../DataTable/modals/CreateEditColumn.svelte | 13 +- .../database/DataTable/popovers/View.svelte | 4 +- .../builder/src/constants/backend/index.js | 153 ++---------------- 3 files changed, 25 insertions(+), 145 deletions(-) diff --git a/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte index f4c60fc8e1..f71db9aada 100644 --- a/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte @@ -46,6 +46,7 @@ const { type, constraints } = fieldDefinitions[ event.target.value.toUpperCase() ] + field.type = type field.constraints = constraints } @@ -58,9 +59,9 @@ secondary thin on:change={handleFieldConstraints} - bind:value={field.value}> + bind:value={field.type}> {#each Object.values(fieldDefinitions) as field} - + {/each} @@ -73,28 +74,28 @@ on:change={() => (field.constraints.presence.allowEmpty = required)} /> - {#if field.value === 'string' && field.constraints} + {#if field.type === 'string' && field.constraints} - {:else if field.value === 'datetime' && field.constraints} + {:else if field.type === 'datetime' && field.constraints} - {:else if field.value === 'number' && field.constraints} + {:else if field.type === 'number' && field.constraints} - {:else if field.value === 'link'} + {:else if field.type === 'link'}