Skip to content

Commit

Permalink
show error message on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek committed Nov 14, 2023
1 parent 5532d0a commit 0d493ca
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 != null && reason.message != null) {
notify.error(reason.message);
return;
}

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

Expand Down

0 comments on commit 0d493ca

Please sign in to comment.