From 105dab7a3dcb34290da25956d406f09d2b85aa7e Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 17 Jun 2023 14:13:37 -0500 Subject: [PATCH] Tweak `SimpleRequestMixin` to not rely on `response.data.ok` instead just assume ok unless `response.data.error` is set --- tailbone/templates/formposter.mako | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tailbone/templates/formposter.mako b/tailbone/templates/formposter.mako index 5c695eb2..ab9c720d 100644 --- a/tailbone/templates/formposter.mako +++ b/tailbone/templates/formposter.mako @@ -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 => {