Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const sendNewData = async () => {
- const fetchData = async () => {
- console.log('token: ' + token);
- result = await Axios.put(
- 'http://veggiesapp.herokuapp.com/me/',
- {
- weight: userWeight,
- height: userHeight,
- age: userAge,
- activity: userActivity,
- },
- {
- headers: {
- 'Content-Type': 'application/json; charset=UTF-8',
- authorization: `Token ${token}`,
- },
- },
- );
- return result;
- };
- await fetchData()
- .then(res => {
- if (res) {
- navigation.push('UserManager');
- }
- })
- .catch(err => {
- console.log(err.response);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement