Api Call Help

For context, I am trying to make a store in my app. It will have in app currency. I have figured out how to do things like give and take away users coin, but I can't figure out how to make an api call where the bought item is added to the area that tracks what the user owns. I have been trying to use a patch api function to edit a table reference sub table, but anytime I use it, it replaces all previous data. I can't figure out how to make the new and original ids all be in the table instead of being replaced.

I will try to lay it out differently. I start with a user. They own items 2 and 3. I set a edit function on the sub table to turn it to 1 and the new value of that sub table is 1. 2 and 3 are no longer there. I am asking how would I set up the api call so that instead of overriding the current contents, it adds to them. So, the table says items 1 2 and 3 after the function is run instead of just 1 because it overrode it. If anything is unclear, PLEASE ask me what I mean. I have put many hours into this trying to figure out how to combine the variables in order to edit without totally replacing the sub table data.

1 reply