Closed srihari20031 closed 1 month ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days.
This issue was closed because it has been stalled for 3 days with no activity.
Bug report
When updating the inventpry quantity of product variants via POST request, the requests is successful and the changes appear in the database, but the get request shows no changes in the inventory quantity (it is 0), and on subsequent POST requests, the new product variant update is present while the previous variant quantity is set to 0.
System information Medusa version (including plugins): Latest(v1.20.9) Node.js version: v18.20.4 Database: Postgresql
Steps to reproduce the behavior
First install inventory module, and stock locations module than perform these,
Send a POST request to update a product variant at: http://localhost:9000/admin/products/prod_01J46QD53800T34M882HZ9T8EK
The request will be success and it will show the inventory quantity as in the below screenshot
Send a GET request to get the product details at: http://localhost:9000/admin/products/prod_01J46QD53800T34M882HZ9T8EK
The request will be success and it will show the inventory quantity as 0 for the previously updated variant as in the below screenshot
Verify that the changes appear in the database Send another POST request to update the same or a different variant Observe that the new update is present, but the previously updated variant's quantity is now 0
Expected behavior All product variant updates should persist in the database, and subsequent updates should not reset previous variants' quantities to 0. Screenshots
Additional context The issue appears to be in the GET method, as the POST method successfully updates the database initially. However, the problem manifests when making subsequent POST requests. There are no internal server errors reported.
https://github.com/user-attachments/assets/d8dceb36-1d09-4030-86c6-d6506e39a455