Skip to content

Commit b11eea3

Browse files
committed
FIX: error handling needs to take account of internal discourse ajax changes
1 parent 78a9c97 commit b11eea3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

assets/javascripts/discourse/components/custom-wizard-step.js.es6

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,7 @@ export default Component.extend({
134134
{
135135
scrollTop: $element.offset().top - 200,
136136
},
137-
400,
138-
function () {
139-
$element.wiggle(2, 100);
140-
}
137+
400
141138
);
142139
}
143140
});

assets/javascripts/discourse/models/custom-wizard-step.js.es6

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ajax } from "discourse/lib/ajax";
44
import discourseComputed from "discourse-common/utils/decorators";
55
import { later } from "@ember/runloop";
66
import { translationOrText } from "discourse/plugins/discourse-custom-wizard/discourse/lib/wizard";
7+
import { extractError } from "discourse/lib/ajax-error";
78

89
export default EmberObject.extend(ValidState, {
910
id: null,
@@ -72,6 +73,9 @@ export default EmberObject.extend(ValidState, {
7273
type: "PUT",
7374
data: { fields },
7475
}).catch((response) => {
76+
if (response.jqXHR) {
77+
response = response.jqXHR;
78+
}
7579
if (response && response.responseJSON && response.responseJSON.errors) {
7680
let wizardErrors = [];
7781
response.responseJSON.errors.forEach((err) => {

0 commit comments

Comments
 (0)