nss-cohort-40 / bangazon-ecommerce-api-silly-walkers-ecommerce-api

bangazon-ecommerce-api-silly-walkers-ecommerce-api created by GitHub Classroom
0 stars 0 forks source link

Add item to cart #55

Closed sarahholder closed 4 years ago

sarahholder commented 4 years ago

In order create function

  1. check to see if you have an order
  2. if no order:
    • make a new order
    • if there is an open order-- add product to that order

In the create -- instead of just instantly creating a new order:

Use try and except for item not there and then do this. neworder= order.objects.create then orderproduct.create and order would be neworder from above.

** Same thing as we are doing in register creating a customer from user

rsnasraty commented 4 years ago

Notes from Joe:

  1. First priority in the next part of the sprint will be adding a product to an order
  2. Always do a POST to orderproduct
  3. All of this info goes in the order CREATE function
  4. The customer needs to be able to SELECT the item