From 7efa06901e220adb94204fddb2761f469344358f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 1 Nov 2021 16:03:53 +0000 Subject: [PATCH] Adding error scenario for table name already in use. --- .../modals/CreateExternalTableModal.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/modals/CreateExternalTableModal.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/modals/CreateExternalTableModal.svelte index c7a040d89a..1d9e246d20 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/modals/CreateExternalTableModal.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/modals/CreateExternalTableModal.svelte @@ -6,8 +6,9 @@ export let datasource let name = "" - - $: valid = name && name.length > 0 + $: valid = name && name.length > 0 && !datasource?.entities[name] + $: error = + name && datasource?.entities[name] ? "Table name already in use." : null function buildDefaultTable(tableName, datasourceId) { return { @@ -40,5 +41,5 @@ Provide a name for your new table; you can add columns once it is created. - +