Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
FIX: error handling needs to take account of internal discourse ajax changes
Dieser Commit ist enthalten in:
Ursprung
78a9c97e43
Commit
b11eea3a06
2 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen
|
@ -134,10 +134,7 @@ export default Component.extend({
|
||||||
{
|
{
|
||||||
scrollTop: $element.offset().top - 200,
|
scrollTop: $element.offset().top - 200,
|
||||||
},
|
},
|
||||||
400,
|
400
|
||||||
function () {
|
|
||||||
$element.wiggle(2, 100);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { ajax } from "discourse/lib/ajax";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import { later } from "@ember/runloop";
|
import { later } from "@ember/runloop";
|
||||||
import { translationOrText } from "discourse/plugins/discourse-custom-wizard/discourse/lib/wizard";
|
import { translationOrText } from "discourse/plugins/discourse-custom-wizard/discourse/lib/wizard";
|
||||||
|
import { extractError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
export default EmberObject.extend(ValidState, {
|
export default EmberObject.extend(ValidState, {
|
||||||
id: null,
|
id: null,
|
||||||
|
@ -72,6 +73,9 @@ export default EmberObject.extend(ValidState, {
|
||||||
type: "PUT",
|
type: "PUT",
|
||||||
data: { fields },
|
data: { fields },
|
||||||
}).catch((response) => {
|
}).catch((response) => {
|
||||||
|
if (response.jqXHR) {
|
||||||
|
response = response.jqXHR;
|
||||||
|
}
|
||||||
if (response && response.responseJSON && response.responseJSON.errors) {
|
if (response && response.responseJSON && response.responseJSON.errors) {
|
||||||
let wizardErrors = [];
|
let wizardErrors = [];
|
||||||
response.responseJSON.errors.forEach((err) => {
|
response.responseJSON.errors.forEach((err) => {
|
||||||
|
|
Laden …
In neuem Issue referenzieren