colleenpurcell12 / CareFull

Grace Shopper for care packages
4 stars 3 forks source link

onEnter to app, create new pending order instance if one does not already exist #41

Closed rahobbs closed 7 years ago

rahobbs commented 7 years ago

Create a new "pending" order instance if there is not already a pending order instance. This is necessary for the cart.

sharonghae commented 7 years ago

onEnter load cart get items in cart /:userid/cart search for order that is pending (where order status pending and current user id) orderproduct for that order to list all items in cart

if there is no pending, create pending order

get order history /:userid/orderhistory all orders by current user (except pending)

post/add item to cart /:userid/cart search for order that is pending (where order status pending and current user id)

add orderproduct - order id and product id

delete item

put - update quantity