I have a reducer that concats a base price when you click on a menu item, then after when the user clicks on a modifier for that menu item its supposed to add a modifier object to the state but instead it just returns the mod_price object only. I am looking to have it return both the base_price and the mod_price, but instead it returns the mod_price object. Below is my code. Any help would be really appreciated.
/*This shows the cart price for only the selected item next to where it says add to cart*/
export const cartPriceForSelectedItem = (state = [],action) => {
const {payload,type} = action;
switch (type) {
case SELECTED_PRICE :
const {base_price} = payload;
return state.concat({base_price: base_price});
case SET_MOD_PRICE_TOTAL :
return state.concat({mod_price: payload})
}
return state;
}