update it

This commit is contained in:
Sukchan Lee 2017-06-19 22:16:12 +09:00
parent 038fd274f0
commit 85c3c83b5f
2 changed files with 2 additions and 3 deletions

View File

@ -13,7 +13,7 @@ export function byIdReducer(state = byIdInitialState, action) {
switch(action.type) {
case CRUD.FETCH_SUCCESS:
const data = state.toJS();
action.payload.forEach((document) => {
action.payload.data.forEach((document) => {
data[document[action.meta.id]] = {
document,
error: null

View File

@ -3,8 +3,7 @@ import { all, takeEvery, put, call, take, fork } from 'redux-saga/effects';
import { CRUD } from 'actions/crud';
const crudApi = (method, url, { params, data } = {} ) => {
return axios({ baseURL: '/api/db', method, url, params, data })
.then(response => response.data);
return axios({ baseURL: '/api/db', method, url, params, data });
}
function* crudEntity(action) {