Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Add toast notification to handle errors when updating a destination (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianli Feng committed Feb 6, 2021
1 parent e240c20 commit a2f990c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class CreateDestination extends React.Component {
params: { destinationId },
},
history,
notifications,
} = this.props;
const { ifSeqNo, ifPrimaryTerm } = this.state;
try {
Expand All @@ -124,6 +125,7 @@ class CreateDestination extends React.Component {
if (resp.ok) {
history.push(`/destinations`);
} else {
backendErrorNotification(notifications, 'update', 'destination', resp.resp);
// Handles stale Destination data.
setSubmitting(false);
this.getDestination(destinationId);
Expand Down

0 comments on commit a2f990c

Please sign in to comment.