Fix warning

This commit is contained in:
Clayton Wilson 2019-10-03 11:23:28 -04:00
parent f14e8bd970
commit 7841fa1798

View File

@ -1,6 +1,18 @@
import {SET_USER, SET_ERRORS, CLEAR_ERRORS, LOADING_UI} from '../types'; import {SET_USER, SET_ERRORS, CLEAR_ERRORS, LOADING_UI} from '../types';
import axios from 'axios'; import axios from 'axios';
export const getUserData = () => (dispatch) => {
axios.get('/user')
.then((res) => {
dispatch({
type: SET_USER,
payload: res.data,
})
})
.catch((err) => console.error(err));
}
export const loginUser = (loginData, history) => (dispatch) => { export const loginUser = (loginData, history) => (dispatch) => {
dispatch({ type: LOADING_UI }); dispatch({ type: LOADING_UI });
axios axios
@ -21,15 +33,4 @@ export const loginUser = (loginData, history) => (dispatch) => {
payload: err.response.data, payload: err.response.data,
}) })
}); });
}
export const getUserData = () => (dispatch) => {
axios.get('/user')
.then((res) => {
dispatch({
type: SET_USER,
payload: res.data,
})
})
.catch((err) => console.error(err));
} }