Skip to content

Commit

Permalink
show error message on delete (#4378)
Browse files Browse the repository at this point in the history
* show error message on delete

* shorten code
  • Loading branch information
petrjasek authored Nov 16, 2023
1 parent 3b9d5c6 commit 30434e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/core/helpers/crud-manager-http.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ export function connectCrudManagerHttp<Props, Entity extends IBaseRestApiRespons
.then(() => this.refresh())
.then(() => {
notify.success(gettext('The item has been deleted.'));
})
.catch((reason) => {
if (reason?.message != null) {
notify.error(reason.message);
return;
}

return Promise.reject(reason);
});
}

Expand Down

0 comments on commit 30434e2

Please sign in to comment.