fga-eps-mds/2019.1-unbrake

View on GitHub
unbrake-frontend/src/actions/RedirectActions.js

Summary

Maintainability
A
0 mins
Test Coverage
import history from "../utils/history";

export const redirect = url => {
  return {
    type: "REDIRECT_PAGE",
    url
  };
};

export const redirectPage = payload => {
  return dispatch => {
    dispatch(redirect(payload.url));
    history.push(`${payload.url}`);
    return redirect;
  };
};

export default redirectPage;