optional chaining for backend ui models
This commit is contained in:
parent
c0d5be49f6
commit
8bac014955
|
@ -30,7 +30,7 @@
|
|||
|
||||
function checkValid(evt) {
|
||||
const tableName = evt.target.value
|
||||
if ($backendUiStore.models.some(model => model.name === tableName)) {
|
||||
if ($backendUiStore.models?.some(model => model.name === tableName)) {
|
||||
error = `Table with name ${tableName} already exists. Please choose another name.`
|
||||
return
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
function checkValid(evt) {
|
||||
const tableName = evt.target.value
|
||||
if (originalName !== tableName && $backendUiStore.models.some(model => model.name === tableName)) {
|
||||
if (originalName !== tableName && $backendUiStore.models?.some(model => model.name === tableName)) {
|
||||
error = `Table with name ${tableName} already exists. Please choose another name.`
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue