After I fill a form in react, and I posted to the working API, I want it to reroute back to /dashboard. I will paste the code that is working
import axios from 'axios';
import { GET_ERRORS } from './types';
const createProject = (project, history) => async dispatch => {
await axios.post('http://localhost:8080/api/project', project)
.catch((error) => {
dispatch({
type: GET_ERRORS,
payload: error.response.data
});
});
};
export default createProject;