diff --git a/app/assets/javascripts/admin/addon/models/admin-user.js b/app/assets/javascripts/admin/addon/models/admin-user.js index 8d4b38baeaa..4a58d212733 100644 --- a/app/assets/javascripts/admin/addon/models/admin-user.js +++ b/app/assets/javascripts/admin/addon/models/admin-user.js @@ -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 ||