|
@@ -60,6 +60,7 @@ const PlannerReducer = (
|
|
|
backlog: state.backlog.filter(recipe => recipe._id !== action.recipe._id)
|
|
backlog: state.backlog.filter(recipe => recipe._id !== action.recipe._id)
|
|
|
}
|
|
}
|
|
|
case 'REMOVE_MEAL':
|
|
case 'REMOVE_MEAL':
|
|
|
|
|
+ const meal = state.planner[action.day][action.meal];
|
|
|
return {
|
|
return {
|
|
|
...state,
|
|
...state,
|
|
|
planner: {
|
|
planner: {
|
|
@@ -68,7 +69,8 @@ const PlannerReducer = (
|
|
|
...state.planner[action.day],
|
|
...state.planner[action.day],
|
|
|
[action.meal]: undefined
|
|
[action.meal]: undefined
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ backlog: meal ? state.backlog.concat([meal]) : state.backlog
|
|
|
}
|
|
}
|
|
|
default:
|
|
default:
|
|
|
return state
|
|
return state
|