1
0
Fork 0
mirror of synced 2024-10-01 01:28:51 +13:00

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

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>