Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 20:02:54 +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,
|
||||
},
|
||||
400,
|
||||
function () {
|
||||
$element.wiggle(2, 100);
|
||||
}
|
||||
400
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Laden …
In neuem Issue referenzieren