Skip to content

Commit 1b2ed6f

Browse files
authored
Update actions.ts catch 401 error
1 parent 19add07 commit 1b2ed6f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/store/form/actions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ export const saveData = () => (dispatch, getState) => {
5151
dispatch(setData(e, false));
5252
dispatch(loadingEnd());
5353
dispatch(setUserEdited(false));
54+
}).catch(e => { // catches 401 and other errors
55+
console.error(e);
56+
dispatch(loadingEnd());
57+
alert("Error saving data " + e);
5458
});
5559
}
5660

@@ -103,4 +107,4 @@ export const declineAdmission = () => (dispatch, getState) => {
103107
dispatch(loadingEnd());
104108
alert("Error " + e);
105109
});
106-
}
110+
}

0 commit comments

Comments
 (0)