summaryrefslogtreecommitdiff
path: root/frontend/views/index
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-06-02 22:21:36 +0200
committerJules Laplace <julescarbon@gmail.com>2020-06-02 22:21:36 +0200
commit70a29089cdb05df27cf50b50fcbc2e53d8975571 (patch)
tree052e7b81291d8ac0c5639c32e4a6f98ce593ba38 /frontend/views/index
parent097e54d4c0646a809eba4ed69929b2a16b682754 (diff)
updating after dragging
Diffstat (limited to 'frontend/views/index')
-rw-r--r--frontend/views/index/graph.reducer.js20
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,