FIX: Error messages from editing user being swallowed (#10908)

This commit is contained in:
Mark VanLandingham 2020-10-13 10:37:33 -05:00 committed by GitHub
parent 95a142741c
commit b19e8ea206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -139,8 +139,8 @@ const AdminUser = User.extend({
bootbox.hideAll();
let error;
AdminUser.find(user.get("id")).then((u) => user.setProperties(u));
if (e.responseJSON && e.responseJSON.errors) {
error = e.responseJSON.errors[0];
if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) {
error = e.jqXHR.responseJSON.errors[0];
}
error = error || I18n.t("admin.user.delete_posts_failed");
bootbox.alert(error);
@ -236,8 +236,8 @@ const AdminUser = User.extend({
.then(() => window.location.reload())
.catch((e) => {
let error;
if (e.responseJSON && e.responseJSON.errors) {
error = e.responseJSON.errors[0];
if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) {
error = e.jqXHR.responseJSON.errors[0];
}
error =
error ||
@ -260,8 +260,8 @@ const AdminUser = User.extend({
.then(() => window.location.reload())
.catch((e) => {
let error;
if (e.responseJSON && e.responseJSON.errors) {
error = e.responseJSON.errors[0];
if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) {
error = e.jqXHR.responseJSON.errors[0];
}
error =
error ||