Hi, I think this
|
item.product.id === action.payload.id); |
should be
let selection = newStore.cart.find(item => item.product.id === action.payload.product.id);
where action.payload.id becomes action.payload.product.id
I am new to javascript and react so I apologize if this is incorrect but this is what I came up with to get the 'Remove' button in the cart to work.
Hi, I think this
pro-react-16/06 - SportsStore - REST and Checkout/sportsstore/src/data/CartReducer.js
Line 35 in 340ed00
should be
let selection = newStore.cart.find(item => item.product.id === action.payload.product.id);where action.payload.id becomes action.payload.product.id
I am new to javascript and react so I apologize if this is incorrect but this is what I came up with to get the 'Remove' button in the cart to work.