ROUTES Products
- Create Products Method: POST Route: /api/products/create Info: Name, Category (ENUM), Price, PictureURL, AvailableStock
User
- Create User -- this is sign up Method: POST Route: /api/user/create Information: Name, Role, DueDate / BirthDay, FirstPregnancy, Address, PhoneNumber, Email, Password. Importante: We are using Passport
- Get a single User Method: GET Route: /api/user/id Returns: Gets all user information from one user
- Get a all Users Method: GET Route: /api/user/ Returns: Gets all user information from all users
- Edit a user Method: PATCH Route: /api/user/edit/id Info: It will update only the information that we send. This route does not update password.
- Sign in Method: POST Route: /authentication/sign-in required fields: email, password
- Sign out Method: POST Route: /authentication/sign-out
WishList
- Create Wishlist Method: POST Route: /api/wishlist/create/id Information: Id in this case is the users Id Important: We need to call this method once the user has been created so as to automatically create the first wishlist.
- Get a Wishlist Method: GET Route: /api/wishlist/id Information: Id of the wishlist Returns: the entire wishlist, which is _id, userId, products wich is Array of Objets [{id, productId, amountWanted, amountBought}]
- Make a parent Add items to the wishlist Method: PATCH Route: /api/wishlist/id Information: ID of the wishlist Adds a new item for the products Array. Information: ProductId, Amount Wanted and Amount Bought (starts at 0)
- Make a gifter gift one item in the wishlist Method: Patch Route: /api/wishlist/gifter/id Find a wishlist and update the amount bought for that specific item
- Delete item from wishlist from Parent Side Method: Patch Route: /api/wishlist/remove/id Information: ID of the wishlist and ID of the product Find a wishlist by id and remove the product from the array
- Get Wishlist by User ID Method: GET Route: /api/wishlist/user/id Information: User ID Next Step: Make this method bring all the wishlists for that specific user.
SANTI TEST WISHLIST http://localhost:3000/wishlist/5df92c900f7b158f8c21e7fb