Adding error scenario for table name already in use.
This commit is contained in:
parent
5d0ce3bf89
commit
1d48ffc38a
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue