(product)
| 38 | } |
| 39 | |
| 40 | const onRemove = (product) => { |
| 41 | foundProduct = cartItems.find((item) => item._id === product._id); |
| 42 | const newCartItems = cartItems.filter((item) => item._id !== product._id); |
| 43 | |
| 44 | setTotalPrice((prevTotalPrice) => prevTotalPrice -foundProduct.price * foundProduct.quantity); |
| 45 | setTotalQty(prevTotalQty => prevTotalQty - foundProduct.quantity); |
| 46 | setCartItems(newCartItems); |
| 47 | } |
| 48 | |
| 49 | const toggleCartItemQuantity = (id, value) => { |
| 50 | foundProduct = cartItems.find((item) => item._id === id) |
nothing calls this directly
no outgoing calls
no test coverage detected