From f7a1b4cb12185c3ac8553ac68ef2714971be635e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 Apr 2024 16:13:46 +0200 Subject: [PATCH] Fix switching types --- .../backend/DataTable/modals/CreateEditColumn.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 3034b40ae6..e56f28dca6 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -170,7 +170,7 @@ $: typeEnabled = !originalName || (originalName && - SWITCHABLE_TYPES[editableColumn.type] && + SWITCHABLE_TYPES[field.type] && !editableColumn?.autocolumn) const fieldDefinitions = Object.values(FIELDS).reduce( @@ -363,9 +363,9 @@ function getAllowedTypes() { if (originalName) { - return ( - SWITCHABLE_TYPES[editableColumn.type] || [editableColumn.type] - ).map(f => FIELDS[f.toUpperCase()]) + return (SWITCHABLE_TYPES[field.type] || [editableColumn.type]).map( + f => FIELDS[f.toUpperCase()] + ) } const isUsers =