From b11eea3a06eeaebea54c3693a7fe9d7ed72d8d20 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Wed, 24 Aug 2022 11:35:17 +0200 Subject: [PATCH] FIX: error handling needs to take account of internal discourse ajax changes --- .../discourse/components/custom-wizard-step.js.es6 | 5 +---- .../javascripts/discourse/models/custom-wizard-step.js.es6 | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/assets/javascripts/discourse/components/custom-wizard-step.js.es6 b/assets/javascripts/discourse/components/custom-wizard-step.js.es6 index 4cc00d14..b98db1ab 100644 --- a/assets/javascripts/discourse/components/custom-wizard-step.js.es6 +++ b/assets/javascripts/discourse/components/custom-wizard-step.js.es6 @@ -134,10 +134,7 @@ export default Component.extend({ { scrollTop: $element.offset().top - 200, }, - 400, - function () { - $element.wiggle(2, 100); - } + 400 ); } }); diff --git a/assets/javascripts/discourse/models/custom-wizard-step.js.es6 b/assets/javascripts/discourse/models/custom-wizard-step.js.es6 index bc72716f..35b76e7c 100644 --- a/assets/javascripts/discourse/models/custom-wizard-step.js.es6 +++ b/assets/javascripts/discourse/models/custom-wizard-step.js.es6 @@ -4,6 +4,7 @@ import { ajax } from "discourse/lib/ajax"; import discourseComputed from "discourse-common/utils/decorators"; import { later } from "@ember/runloop"; import { translationOrText } from "discourse/plugins/discourse-custom-wizard/discourse/lib/wizard"; +import { extractError } from "discourse/lib/ajax-error"; export default EmberObject.extend(ValidState, { id: null, @@ -72,6 +73,9 @@ export default EmberObject.extend(ValidState, { type: "PUT", data: { fields }, }).catch((response) => { + if (response.jqXHR) { + response = response.jqXHR; + } if (response && response.responseJSON && response.responseJSON.errors) { let wizardErrors = []; response.responseJSON.errors.forEach((err) => {