diff --git a/ordering/src/components/Cart/Cart.js b/ordering/src/components/Cart/Cart.js index d4f17d2..0fa35c5 100644 --- a/ordering/src/components/Cart/Cart.js +++ b/ordering/src/components/Cart/Cart.js @@ -11,8 +11,13 @@ function Cart(props) { const totalAmount = `$${cartCtx.totalAmount.toFixed(2)}` const hasItems = cartCtx.items.length > 0 - const cartItemRemoveHandler = id => {} - const cartItemAddHandler = items => {} + const cartItemRemoveHandler = (id) => { + cartCtx.removeItem(id) + + } + const cartItemAddHandler = (item) => { + cartCtx.addItem({ ...item, amount: 1 }) + } const cartItems = (