From 70a29089cdb05df27cf50b50fcbc2e53d8975571 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 2 Jun 2020 22:21:36 +0200 Subject: updating after dragging --- frontend/views/index/graph.reducer.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'frontend/views/index') 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, -- cgit v1.2.3-70-g09d2