Fix bug data sent

This commit is contained in:
soupette 2018-08-01 13:42:31 +02:00
parent ac382484b3
commit 97e8bd46e2

View File

@ -1,5 +1,5 @@
import { LOCATION_CHANGE } from 'react-router-redux';
import { findIndex } from 'lodash';
import { findIndex, get } from 'lodash';
import { takeLatest, put, fork, take, cancel, select, call } from 'redux-saga/effects';
import request from 'utils/request';
@ -64,7 +64,7 @@ export function* dataFetch(action) {
export function* submitData(action) {
try {
const body = yield select(makeSelectModifiedData());
const opts = { method: 'PUT', body: (action.endPoint === 'advanced') ? body.settings : body };
const opts = { method: 'PUT', body: (action.endPoint === 'advanced') ? get(body, ['advanced', 'settings'], {}) : body };
yield call(request, `/users-permissions/${action.endPoint}`, opts);
yield put(submitSucceeded());