update it
This commit is contained in:
parent
038fd274f0
commit
85c3c83b5f
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue