Tweak SimpleRequestMixin
to not rely on response.data.ok
instead just assume ok unless `response.data.error` is set
This commit is contained in:
parent
ba2b4bf12c
commit
105dab7a3d
|
@ -47,10 +47,7 @@
|
||||||
|
|
||||||
this.$http.post(action, params, {headers: headers}).then(response => {
|
this.$http.post(action, params, {headers: headers}).then(response => {
|
||||||
|
|
||||||
if (response.data.ok) {
|
if (response.data.error) {
|
||||||
success(response)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.$buefy.toast.open({
|
this.$buefy.toast.open({
|
||||||
message: "Submit failed: " + (response.data.error ||
|
message: "Submit failed: " + (response.data.error ||
|
||||||
"(unknown error)"),
|
"(unknown error)"),
|
||||||
|
@ -60,6 +57,9 @@
|
||||||
if (failure) {
|
if (failure) {
|
||||||
failure(response)
|
failure(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
success(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
}, response => {
|
}, response => {
|
||||||
|
|
Loading…
Reference in a new issue