Skip to content

Commit df5f963

Browse files
authored
Merge pull request #4097 from techmatters/copilot/sub-pr-4095
Fix async error handling in DispatchIncidentButton: await newIncidentDispatchAction dispatch
2 parents fc337cc + 498ed41 commit df5f963

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

plugin-hrm-form/src/components/customIntegrations/uscr/DispatchIncidentButton.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ const DispatchIncidentButton: React.FC<Props> = ({ contactId }) => {
105105
const valid = await trigger();
106106
if (valid) {
107107
await saveDraft();
108-
// We use a regular dispatch here because we handle the error from where it is called.
109-
dispatch(newIncidentDispatchAction(savedContact));
108+
await dispatch(newIncidentDispatchAction(savedContact));
110109
Notifications.showNotificationSingle(dispatchSuccessNotification);
111110
}
112111
} catch (err) {

0 commit comments

Comments
 (0)