summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-09-26 14:41:27 +0200
committerJules Laplace <julescarbon@gmail.com>2020-09-26 14:41:27 +0200
commit62f491d7bb3e1a3c44ad35a5250896e4d1c74c9d (patch)
tree0fecb4cad0fc6f353dead0cbe11f212db71a6ddd
parentc01b42ad2792f97d65b204faefabb35832ac571b (diff)
fix bug in crud reducer
-rw-r--r--animism-align/frontend/app/api/crud.reducer.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/animism-align/frontend/app/api/crud.reducer.js b/animism-align/frontend/app/api/crud.reducer.js
index 3ee4974..2a7e4c4 100644
--- a/animism-align/frontend/app/api/crud.reducer.js
+++ b/animism-align/frontend/app/api/crud.reducer.js
@@ -116,11 +116,13 @@ export const crudReducer = (type) => {
update: action.data,
index: addToIndex(state.index, action.data.res, state.options.sort),
show: (state.show.res && state.show.res.id === action.data.res.id) ? {
- ...state.show.res,
- ...action.data.res,
+ res: {
+ ...state.show.res,
+ ...action.data.res,
+ }
} : state.show
}
- case crud_type.index_error:
+ case crud_type.update_error:
return {
...state,
update: { loading: false, error: true },