redirect to created datasource
This commit is contained in:
parent
29551c4621
commit
a833df7771
|
@ -1,10 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
|
import { goto } from "@roxi/routify"
|
||||||
import { ModalContent, notifications } from "@budibase/bbui"
|
import { ModalContent, notifications } from "@budibase/bbui"
|
||||||
import IntegrationConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte"
|
import IntegrationConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte"
|
||||||
import { datasources, tables } from "stores/backend"
|
import { datasources, tables } from "stores/backend"
|
||||||
import { IntegrationNames } from "constants"
|
import { IntegrationNames } from "constants"
|
||||||
|
|
||||||
export let integration
|
export let integration
|
||||||
|
|
||||||
function prepareData() {
|
function prepareData() {
|
||||||
let datasource = {}
|
let datasource = {}
|
||||||
let existingTypeCount = $datasources.list.filter(
|
let existingTypeCount = $datasources.list.filter(
|
||||||
|
@ -31,8 +33,8 @@
|
||||||
if (integration.plus) {
|
if (integration.plus) {
|
||||||
updateDatasourceSchema(resp)
|
updateDatasourceSchema(resp)
|
||||||
}
|
}
|
||||||
await datasources.select(resp["_id"])
|
await datasources.select(resp._id)
|
||||||
console.log($datasources)
|
$goto(`./datasource/${resp._id}`)
|
||||||
notifications.success(`Datasource updated successfully.`)
|
notifications.success(`Datasource updated successfully.`)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifications.error(`Error saving datasource: ${err}`)
|
notifications.error(`Error saving datasource: ${err}`)
|
||||||
|
@ -42,7 +44,6 @@
|
||||||
async function updateDatasourceSchema(datasourceJson) {
|
async function updateDatasourceSchema(datasourceJson) {
|
||||||
try {
|
try {
|
||||||
await datasources.updateSchema(datasourceJson)
|
await datasources.updateSchema(datasourceJson)
|
||||||
notifications.success(`Datasource ${name} tables updated successfully.`)
|
|
||||||
await tables.fetch()
|
await tables.fetch()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifications.error(`Error updating datasource schema: ${err}`)
|
notifications.error(`Error updating datasource schema: ${err}`)
|
||||||
|
|
Loading…
Reference in New Issue