Fix flash on creation

This commit is contained in:
Adria Navarro 2025-03-14 10:58:37 +01:00
parent fcd7ef2e0b
commit da654f6f8e
1 changed files with 7 additions and 6 deletions

View File

@ -184,8 +184,6 @@
const isNew = !query._rev
const { _id } = await queries.save(toSave.datasourceId, toSave)
saveId = _id
query = getSelectedQuery()
notifications.success(`Request saved successfully`)
if (dynamicVariables) {
datasource.config.dynamicVariables = rebuildVariables(saveId)
datasource = await datasources.save({
@ -193,6 +191,13 @@
datasource,
})
}
notifications.success(`Request saved successfully`)
if (isNew) {
$goto(`../../${_id}`)
}
query = getSelectedQuery()
prettifyQueryRequestBody(
query,
requestBindings,
@ -203,10 +208,6 @@
// Force rebuilding original query
originalQuery = null
if (isNew) {
$goto(`../../${_id}`)
}
} catch (err) {
notifications.error(`Error saving query`)
} finally {