Skip to content

Commit

Permalink
fix(graphql): emit notifications on server error response (#1218)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Feb 29, 2024
1 parent 8c5cd31 commit 947a706
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/Shared/Services/Api.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,14 @@ export class ApiService {
).pipe(
map((resp) => resp.json()),
concatMap(from),
tap((resp) => {
if (suppressNotifications || !resp?.errors?.length) {
return;
}
resp.errors.forEach((err) =>
this.notifications.danger(`Request failed (${err.extensions.classification})`, err.message),
);
}),
first(),
);
}
Expand Down

0 comments on commit 947a706

Please sign in to comment.