Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. export const createUser = () => {
  2. return async (dispatch) => {
  3. dispatch({ type: CREATE_USER });
  4.  
  5. console.log('we are in the create user function');
  6.  
  7. try {
  8. let response = await fetch('secret.com/v1/login/signup', {
  9. method: 'POST',
  10. headers: {
  11. Accept: 'application/json',
  12. 'Content-Type': 'application/json'
  13. },
  14. body: JSON.stringify({
  15. password: 'Asadasd123123',
  16. first_name: 'joe',
  17. last_name: 'doe',
  18. phone_number: '373738'
  19. })
  20. });
  21. console.log('response ' + JSON.stringify(response));
  22. } catch (error) {
  23. console.log(error);
  24. }
  25. };
  26. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement