diff options
Diffstat (limited to 'frontend/views/index/graph.reducer.js')
| -rw-r--r-- | frontend/views/index/graph.reducer.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/frontend/views/index/graph.reducer.js b/frontend/views/index/graph.reducer.js index e0ded41..9f42f52 100644 --- a/frontend/views/index/graph.reducer.js +++ b/frontend/views/index/graph.reducer.js @@ -15,9 +15,27 @@ const initialState = crudState('graph', { const reducer = crudReducer('graph') export default function graphReducer(state = initialState, action) { - // console.log(action.type, action) + console.log(action.type, action) state = reducer(state, action) switch (action.type) { + case types.graph.update_graph_page: + return { + ...state, + show: { + ...state.show, + res: { + ...state.show.res, + pages: state.show.res.pages.map(page => { + if (page.id === action.page.id) { + return { ...action.page } + } else { + return page + } + }), + } + } + } + case types.graph.show_add_page_form: return { ...state, |
