1
0
Fork 0
mirror of synced 2024-09-30 17:18:14 +13:00

ensure error is thrown on client validation failure

This commit is contained in:
Martin McKeaveney 2021-02-23 10:41:11 +00:00
parent 3c3677a88e
commit 50f9663622

View file

@ -135,6 +135,9 @@ export const getBackendUiStore = () => {
}
query.datasourceId = datasourceId
const response = await api.post(`/api/queries`, query)
if (response.status !== 200) {
throw new Error("Failed saving query.")
}
const json = await response.json()
store.update(state => {
const currentIdx = state.queries.findIndex(