I’m building an inventory management app and this is one part of it.
1. Inventory Management App (inventory)This app is responsible for managing raw materials and products inventory. It also includes categories to better organize products.
I have Django as backend with a react frontend. I don’t have much coding background but I can understand the basics. I used chatgpt to help with my coding.
I have the Product model which includes its name, code, quantity, size, price, etc.
I have the Stock model which will update the quantity of the product from each of its entry.
I was able to show the Stock List on the page. When I added the CRUD operations to it, it seems to fail due a datatype mismatch when sending a PUT request to the API.
I have attached images for the GET request: GET.png
Even from the REST framework page “http://127.0.0.1:8000/api/inventory/stock/1/” it fails (json), but with HTML form it works.
Here is the image for the PUT: PUT.png
Here is the output from the terminal:
Bad Request: /api/inventory/stock/1/
[19/Jan/2025 14:25:19] "PUT /api/inventory/stock/1/ HTTP/1.1" 400 11829