Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. const sendNewData = async () => {
  2. const fetchData = async () => {
  3. console.log('token: ' + token);
  4. result = await Axios.put(
  5. 'http://veggiesapp.herokuapp.com/me/',
  6. {
  7. weight: userWeight,
  8. height: userHeight,
  9. age: userAge,
  10. activity: userActivity,
  11. },
  12. {
  13. headers: {
  14. 'Content-Type': 'application/json; charset=UTF-8',
  15. authorization: `Token ${token}`,
  16. },
  17. },
  18. );
  19. return result;
  20. };
  21. await fetchData()
  22. .then(res => {
  23. if (res) {
  24. navigation.push('UserManager');
  25. }
  26. })
  27. .catch(err => {
  28. console.log(err.response);
  29. });
  30. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement