Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. export function loginUser () {
  2. return (dispatch, getState) => {
  3.  
  4. const endPoint = "/api/v0/login"
  5.  
  6. const body = JSON.stringify({
  7. "email": "xxx@gmail.com",
  8. "password": "12345"
  9. });
  10.  
  11. axios({
  12. "method": "POST",
  13. "url": endPoint,
  14. "data": body
  15. })
  16. .then((response) => {
  17. dispatch(requestAccessToken(response.data.token));
  18. })
  19. .catch((error) => {
  20. console.warn(error)
  21. });
  22. };
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement