Adding error scenario for table name already in use.

This commit is contained in:
mike12345567 2021-11-01 16:03:53 +00:00
parent 835b0efe74
commit 7efa06901e
1 changed files with 4 additions and 3 deletions

View File

@ -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 @@
<Body
>Provide a name for your new table; you can add columns once it is created.</Body
>
<Input label="Table Name" bind:value={name} />
<Input label="Table Name" bind:error bind:value={name} />
</ModalContent>