mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 10:18:48 +00:00
Fix warning
This commit is contained in:
parent
f14e8bd970
commit
7841fa1798
@ -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));
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user