fix layout of config modal

This commit is contained in:
Peter Clement 2021-09-27 10:04:01 +01:00
parent dad6412271
commit 7121b0a7c8
1 changed files with 2 additions and 10 deletions

View File

@ -27,20 +27,15 @@
return datasource return datasource
} }
async function saveDatasource() { async function saveDatasource() {
let success = true
try { try {
// Create datasource // Create datasource
const resp = await datasources.save(prepareData()) const resp = await datasources.save(prepareData())
if (integration.plus) { if (integration.plus) {
fetchedSchema = updateDatasourceSchema(resp) updateDatasourceSchema(resp)
} }
if (!fetchedSchema) {
return false
}
await datasources.select(resp._id) await datasources.select(resp._id)
$goto(`./datasource/${resp._id}`)
notifications.success(`Datasource updated successfully.`) notifications.success(`Datasource updated successfully.`)
analytics.captureEvent(Events.DATASOURCE.CREATED, { analytics.captureEvent(Events.DATASOURCE.CREATED, {
name: resp.name, name: resp.name,
@ -48,7 +43,6 @@
}) })
} catch (err) { } catch (err) {
notifications.error(`Error saving datasource: ${err}`) notifications.error(`Error saving datasource: ${err}`)
return false
} }
} }
@ -56,10 +50,8 @@
try { try {
await datasources.updateSchema(datasourceJson) await datasources.updateSchema(datasourceJson)
await tables.fetch() await tables.fetch()
return true
} catch (err) { } catch (err) {
notifications.error(`Error updating datasource schema: ${err}`) notifications.error(`Error updating datasource schema: ${err}`)
return false
} }
} }
</script> </script>