mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
efb35b537a
* add prettier and have it format all js code except website: : * trying running prettier check in CI * fix runs on in CI * change CI job name * fix prettier erros and fix CI
26 lines
686 B
JavaScript
26 lines
686 B
JavaScript
import PATHS from "router/paths";
|
|
import { push } from "react-router-redux";
|
|
import { renderFlash } from "redux/nodes/notifications/actions";
|
|
import userActions from "redux/nodes/entities/users/actions";
|
|
|
|
const confirmEmailChange = (dispatch, token, user) => {
|
|
if (user && token) {
|
|
return dispatch(userActions.confirmEmailChange(user, token))
|
|
.then(() => {
|
|
dispatch(push(PATHS.USER_SETTINGS));
|
|
dispatch(renderFlash("success", "Email updated successfully!"));
|
|
|
|
return false;
|
|
})
|
|
.catch(() => {
|
|
dispatch(push(PATHS.LOGIN));
|
|
|
|
return false;
|
|
});
|
|
}
|
|
|
|
return Promise.resolve();
|
|
};
|
|
|
|
export default { confirmEmailChange };
|