Skip to content

Commit

Permalink
toaster for user errors in tab9
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Corny committed May 29, 2024
1 parent 3eb0989 commit 5b6bf8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/gn_module_zh/hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,7 @@ def __check_if_rules(self):
raise ZHApiError(
message="no_rb_rules",
details="no existing rules for the river basin",
status_code=400
)
except ZHApiError:
raise
Expand Down
4 changes: 4 additions & 0 deletions frontend/app/services/hierarchy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export class HierarchyService {
this._toastr.warning("La ZH n'est présente dans aucun bassin versant", '', {
closeButton: true,
});
} else if (error.status === 400) {
this._toastr.warning(this._error['errors'].filter(i => error.error['message'] === i.api )[0].front, '', {
closeButton: true,
});
}
},
() => {
Expand Down

0 comments on commit 5b6bf8f

Please sign in to comment.