Is it possible to make a PUT request via the strapi REST API that lets me update a many to many relationship field by just supplying the id I want to add… without supplying all the existing ids?
Currently doing this:
const heart = await fetch(url, {
method: ‘PUT’,
headers: {
‘Authorization’: Bearer ${jwt}
,
‘Content-Type’: ‘application/json’
},
body: JSON.stringify({
“data”: {
“HeartedBy”: [uid],
}
})
})
HeartedBy is a list of user ids who have hearted that item. But each time I do it, the current user just overwrites the previous user. I want to obviously continue to add to the list. Do I have to fetch all the current HeartedBy values every time I want to add to this so that I’m always supplying the whole list?
This topic has been created from a Discord post (1250905017272107080) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord