Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Login the user
- export const getUserLogin = (email, password) => {
- let
- url = `${GT_API_URL}/login`
- ;
- console.log('getUserLogin');
- return function (dispatch) {
- dispatch(userLoginRequest());
- return axios({
- url : url,
- timeout : 20000,
- method : 'post',
- responseType : 'json',
- data : {
- email : email,
- password : password
- }
- })
- .then(
- response => {
- console.log('success for user login response');
- dispatch(userLoginSuccess(response)); // Store it in the state
- },
- error => {
- console.log('fail to login user');
- dispatch(userLoginFailure());
- // Track the error
- piwik.trackError( { message: error, filename: 'userAction', lineno: 229 }, 'User Login Error');
- }
- )
- ;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement