Merge pull request #8797 from Budibase/bug/sev2/no-fetch-create-table

Allow tables to be created even if no fetch
This commit is contained in:
melohagan 2022-11-24 12:06:44 +00:00 committed by GitHub
commit a9402c4ab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -7,9 +7,9 @@
let name = ""
let submitted = false
$: valid = name && name.length > 0 && !datasource?.entities[name]
$: valid = name && name.length > 0 && !datasource?.entities?.[name]
$: error =
!submitted && name && datasource?.entities[name]
!submitted && name && datasource?.entities?.[name]
? "Table name already in use."
: null

View File

@ -190,6 +190,9 @@ exports.save = async function (ctx) {
const db = getAppDB()
const datasource = await db.get(datasourceId)
if (!datasource.entities) {
datasource.entities = {}
}
const oldTables = cloneDeep(datasource.entities)
const tables = datasource.entities