diff options
Diffstat (limited to 'frontend/api/crud.reducer.js')
| -rw-r--r-- | frontend/api/crud.reducer.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/frontend/api/crud.reducer.js b/frontend/api/crud.reducer.js index dd1fe48..2a7e4c4 100644 --- a/frontend/api/crud.reducer.js +++ b/frontend/api/crud.reducer.js @@ -1,6 +1,6 @@ -import * as types from '../types' -import { getOrderedIds, getOrderedIdsFromLookup } from '../util' -import { session } from '../session' +import * as types from 'app/types' +import { getOrderedIds, getOrderedIdsFromLookup } from 'app/utils' +import { session } from 'app/session' export const crudState = (type, options) => ({ index: {}, @@ -115,14 +115,14 @@ export const crudReducer = (type) => { ...state, update: action.data, index: addToIndex(state.index, action.data.res, state.options.sort), - show: (state.show && state.show.res) ? { - res: (state.show.res.id === action.data.res.id ? { + show: (state.show.res && state.show.res.id === action.data.res.id) ? { + res: { ...state.show.res, ...action.data.res, - } : state.show.res), - } : {} + } + } : state.show } - case crud_type.index_error: + case crud_type.update_error: return { ...state, update: { loading: false, error: true }, |
