UX: Show information about badge errors when saving

`popupAjaxError` is used by the controller to handle errors when saving the badge model. That only works properly when it gets the original exception from the ajax call. This manipulation of the error in the badge model was breaking that behavior.

The admin-badges controller is the only place which saves this model, so this shouldn't cause any issues elsewhere in the app.
This commit is contained in:
David Taylor 2022-08-31 18:43:12 +01:00
parent 240669da3a
commit 15025ac958
1 changed files with 4 additions and 8 deletions

View File

@ -45,13 +45,9 @@ const Badge = RestModel.extend({
type = "PUT";
}
return ajax(url, { type, data })
.then((json) => {
return ajax(url, { type, data }).then((json) => {
this.updateFromJson(json);
return this;
})
.catch((error) => {
throw new Error(error);
});
},