Skip to content

Commit

Permalink
feat: replace alerts in Pilot page for the warning system
Browse files Browse the repository at this point in the history
  • Loading branch information
mbetancurt committed Jul 3, 2020
1 parent 069c584 commit 5718ba7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dashboard/user/Pilot.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Pilot({user}) {
.put('/user/password/' + newUserData.username, newUserData, {headers: {auth: fM(state.auth.token)}})
.then(() =>
actions.auth.info(newUserData.username, () => {
alert('Password change was successful');
actions.warning.setWarning('Password change was successful');
setUserDataChangeEnabled(true);
}, () => {
actions.auth.logout();
Expand All @@ -56,14 +56,14 @@ function Pilot({user}) {
.put('/user/info/' + newUserData.username, newUserData, {headers: {auth: fM(state.auth.token)}})
.then(() =>
actions.auth.info(newUserData.username, () => {
alert('Data change was successful');
actions.warning.setWarning('Data change was successful');
setUserDataChangeEnabled(true);
}, () => {
actions.auth.logout();
})
)
.catch((error) => {
alert('Data change failed: ' + error.response.data[0]);
actions.warning.setWarning('Data change failed: ' + error.response.data[0]);
setUserDataChangeEnabled(true);
});
};
Expand Down

0 comments on commit 5718ba7

Please sign in to comment.