include-davis / Include-Estore-API

MIT License
0 stars 0 forks source link

Created Product and Inventory #19

Open KiranJoji opened 3 months ago

KiranJoji commented 3 months ago

I created Product and Inventory models and implemented CRUD operations. I also ensured that inventories were created upon the creation of products. For now, I set all default values to 0 or empty strings.

KiranJoji commented 2 months ago

I adjusted the code but realized I couldn't remove the product code because the current product code was off. The names of the files are wrong and the update for products is creating a user.

KiranJoji commented 1 month ago

There is some issue with passing the product_id and tag_name to different queries with ProductToTag. For example, if you try to query Product and Tag through manyPTTs (finding all ProductToTags), the find functions for Product and Tag are passed undefined values. I've spent a long time trying to figure out why but I can't figure it out. It may be connected to how, when creating or deleting ProductToTag, you can't use const { productId, tagName, } = input; when its fine for other model creates. It thinks productId and tagName is undefined, but it works if you use product_id and tag_name (which breaks the lint check since it is not camel case).