commit
d4dc591247
|
@ -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(
|
||||||
|
|
|
@ -27,7 +27,7 @@ function generateQueryValidation() {
|
||||||
readable: Joi.boolean(),
|
readable: Joi.boolean(),
|
||||||
parameters: Joi.array().items(Joi.object({
|
parameters: Joi.array().items(Joi.object({
|
||||||
name: Joi.string(),
|
name: Joi.string(),
|
||||||
default: Joi.string()
|
default: Joi.string().allow(""),
|
||||||
})),
|
})),
|
||||||
queryVerb: Joi.string().allow().required(),
|
queryVerb: Joi.string().allow().required(),
|
||||||
schema: Joi.object({}).required().unknown(true)
|
schema: Joi.object({}).required().unknown(true)
|
||||||
|
|
Loading…
Reference in New Issue