From 7841fa179807daad871e9c3d73019f3ccdeee40f Mon Sep 17 00:00:00 2001 From: Clayton Wilson Date: Thu, 3 Oct 2019 11:23:28 -0400 Subject: [PATCH] Fix warning --- .../src/redux/actions/userActions.js | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/twistter-frontend/src/redux/actions/userActions.js b/twistter-frontend/src/redux/actions/userActions.js index 2177a75..cc6eb56 100644 --- a/twistter-frontend/src/redux/actions/userActions.js +++ b/twistter-frontend/src/redux/actions/userActions.js @@ -1,6 +1,18 @@ import {SET_USER, SET_ERRORS, CLEAR_ERRORS, LOADING_UI} from '../types'; 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) => { dispatch({ type: LOADING_UI }); axios @@ -21,15 +33,4 @@ export const loginUser = (loginData, history) => (dispatch) => { 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)); } \ No newline at end of file