Adding error scenario for table name already in use.
This commit is contained in:
parent
835b0efe74
commit
7efa06901e
|
@ -6,8 +6,9 @@
|
||||||
export let datasource
|
export let datasource
|
||||||
|
|
||||||
let name = ""
|
let name = ""
|
||||||
|
$: valid = name && name.length > 0 && !datasource?.entities[name]
|
||||||
$: valid = name && name.length > 0
|
$: error =
|
||||||
|
name && datasource?.entities[name] ? "Table name already in use." : null
|
||||||
|
|
||||||
function buildDefaultTable(tableName, datasourceId) {
|
function buildDefaultTable(tableName, datasourceId) {
|
||||||
return {
|
return {
|
||||||
|
@ -40,5 +41,5 @@
|
||||||
<Body
|
<Body
|
||||||
>Provide a name for your new table; you can add columns once it is created.</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>
|
</ModalContent>
|
||||||
|
|
Loading…
Reference in New Issue