Fix flash on creation
This commit is contained in:
parent
fcd7ef2e0b
commit
da654f6f8e
|
@ -184,8 +184,6 @@
|
||||||
const isNew = !query._rev
|
const isNew = !query._rev
|
||||||
const { _id } = await queries.save(toSave.datasourceId, toSave)
|
const { _id } = await queries.save(toSave.datasourceId, toSave)
|
||||||
saveId = _id
|
saveId = _id
|
||||||
query = getSelectedQuery()
|
|
||||||
notifications.success(`Request saved successfully`)
|
|
||||||
if (dynamicVariables) {
|
if (dynamicVariables) {
|
||||||
datasource.config.dynamicVariables = rebuildVariables(saveId)
|
datasource.config.dynamicVariables = rebuildVariables(saveId)
|
||||||
datasource = await datasources.save({
|
datasource = await datasources.save({
|
||||||
|
@ -193,6 +191,13 @@
|
||||||
datasource,
|
datasource,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
notifications.success(`Request saved successfully`)
|
||||||
|
if (isNew) {
|
||||||
|
$goto(`../../${_id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
query = getSelectedQuery()
|
||||||
prettifyQueryRequestBody(
|
prettifyQueryRequestBody(
|
||||||
query,
|
query,
|
||||||
requestBindings,
|
requestBindings,
|
||||||
|
@ -203,10 +208,6 @@
|
||||||
|
|
||||||
// Force rebuilding original query
|
// Force rebuilding original query
|
||||||
originalQuery = null
|
originalQuery = null
|
||||||
|
|
||||||
if (isNew) {
|
|
||||||
$goto(`../../${_id}`)
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifications.error(`Error saving query`)
|
notifications.error(`Error saving query`)
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in New Issue