(productId)
| 45 | } |
| 46 | |
| 47 | export function removeFromCart(productId) { |
| 48 | const newCart = []; |
| 49 | |
| 50 | cart.forEach((cartItem) => { |
| 51 | if (cartItem.productId !== productId) { |
| 52 | newCart.push(cartItem); |
| 53 | } |
| 54 | }); |
| 55 | |
| 56 | cart = newCart; |
| 57 | |
| 58 | saveToStorage(); |
| 59 | } |
| 60 | |
| 61 | export function updateDeliveryOption(productId, deliveryOptionId) { |
| 62 | let matchingItem; |
no test coverage detected