I’ve been working on a mobile app using react native as my frontend and WordPress as my backend. I’ve been able to login using the JWT token thereby generating a token for order secured activity. Right now, I’m in a fixed trying to update an ACF field using the generated token. Gone through all the documentation but still not working. Please help me out on this.
const trackingServerUpdate = async()=>{
const form = {"fields":{"status": "Picked Up"}}
try{
const postStatus = await fetch(`https://mysite/wp-json/wp/v2/logistics/${items.id}`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`,
},
body: JSON.stringify({
form
})
});
const reply = await postStatus.json()
console.log(reply)
}catch(e){
console.log(e)
}
}