Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4056

How to update array using PUT API request in Strapi

$
0
0

I want to update array in the product "table" via PUT request.lets say users array (product has many users)

localhost:1337/api/products/2

i am sending data in body

{"data": {"users": [4,6,8] //i want to push here next user but in json it is impossible [...users, newUser]  }}

the problem is that my previous values which was in the arrray are lost when i use put becouse this is how PUT works.

Why i need it? I use strapi and there relation is made via array. I just need to update array. But i dont know how to do this.

Maybe should i to use redux and push value to array in store and then update??


Viewing all articles
Browse latest Browse all 4056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>