Tweak SimpleRequestMixin to not rely on response.data.ok

instead just assume ok unless `response.data.error` is set
This commit is contained in:
Lance Edgar 2023-06-17 14:13:37 -05:00
parent ba2b4bf12c
commit 105dab7a3d

View file

@ -47,10 +47,7 @@
this.$http.post(action, params, {headers: headers}).then(response => {
if (response.data.ok) {
success(response)
} else {
if (response.data.error) {
this.$buefy.toast.open({
message: "Submit failed: " + (response.data.error ||
"(unknown error)"),
@ -60,6 +57,9 @@
if (failure) {
failure(response)
}
} else {
success(response)
}
}, response => {