score:1

Accepted answer
case ADD_INGREDIENT_TO_MENU_ITEM_CART: {
    const { menu_item_id, ingrediant } = action.payload;

    const nextState = state.map(item => {
        if (item.menu_item_id !== menu_item_id) {
            // not our item, return it as is
            return item;
        }

        // this is our relevant item, return a new copy of it with modified fields
        return {
            ...item,
            ingrediantTotal: ingrediant.price,
            ingrediants: [
                ...item.ingrediants,
                ingrediant
            ]
        }
    });

    return nextState;
}

Related Query

More Query from same tag