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