I have a problem, I need to change the product quantity value. When a customer creates a new order, I need to change the quantity of the product in stock from the order, but I don't know how I can change the value in sanity using the code.
I tried to find a solution on the internet, but I couldn't find anything. I only found how to create comments (it's similar), but not how to edit comments.
Any solutions?
I found solution just add this code client.patch(docID).dec({quantity: 1}).commit()
(https://www.sanity.io/schemas/mutate-set-or-change-values-deep-within-documents-psPXQ26_wA_i).