ensure error is thrown on client validation failure
This commit is contained in:
parent
8d500584b2
commit
cdad198103
|
@ -135,6 +135,9 @@ export const getBackendUiStore = () => {
|
||||||
}
|
}
|
||||||
query.datasourceId = datasourceId
|
query.datasourceId = datasourceId
|
||||||
const response = await api.post(`/api/queries`, query)
|
const response = await api.post(`/api/queries`, query)
|
||||||
|
if (response.status !== 200) {
|
||||||
|
throw new Error("Failed saving query.")
|
||||||
|
}
|
||||||
const json = await response.json()
|
const json = await response.json()
|
||||||
store.update(state => {
|
store.update(state => {
|
||||||
const currentIdx = state.queries.findIndex(
|
const currentIdx = state.queries.findIndex(
|
||||||
|
|
Loading…
Reference in New Issue