Hi Im trying to post something on a component using
const [values, setValues]=useState(
{
bench:’’,
machine:’’,
fly:’’,
pushups:’’
})
and
const res = await fetch(${*API_URL*}/chests
, {
method:‘POST’,
headers:
{‘Content-Type’: ‘application/json’},
body: JSON.stringify( values)
})
and this is the response
- {id: 8, published_at: ‘2021-10-11T12:59:51.273Z’, created_at: ‘2021-10-11T12:59:51.275Z’, updated_at: ‘2021-10-11T12:59:51.275Z’, upper: null}
- created_at: “2021-10-11T12:59:51.275Z”
- id: 8
- published_at: “2021-10-11T12:59:51.273Z”
- updated_at: “2021-10-11T12:59:51.275Z”
- upper: null
- [[Prototype]]: Object
i cant get to the upper component … what am I doing wrong here?