This commit is contained in:
soupette 2018-08-20 17:13:05 +02:00
parent fb07e39a38
commit ef59452b9a
2 changed files with 2 additions and 4 deletions

View File

@ -240,7 +240,7 @@ function setAttributeFormData(hash) {
const type = formType === 'number' ? 'integer' : formType;
let defaultValue = type === 'number' ? 0 : '';
if (type === 'checkbox') {
if (type === 'boolean') {
defaultValue = false;
}

View File

@ -57,7 +57,6 @@ export function* submitChanges(action) {
try {
// Show button loader
yield put(setButtonLoader());
const modelName = get(storeData.getContentType(), 'name');
const data = yield select(makeSelectModel());
const body = cloneDeep(data);
@ -83,7 +82,7 @@ export function* submitChanges(action) {
set(body.attributes[index].params, 'plugin', true);
}
if (!value && key !== 'multiple') {
if (!value && key !== 'multiple' && key !== 'default') {
const paramsKey = includes(key, 'Value') ? replace(key,'Value', '') : key;
unset(body.attributes[index].params, paramsKey);
}
@ -99,7 +98,6 @@ export function* submitChanges(action) {
const baseUrl = '/content-type-builder/models/';
const requestUrl = method === 'POST' ? baseUrl : `${baseUrl}${body.name}`;
const opts = { method, body };
const response = yield call(request, requestUrl, opts, true);
if (response.ok) {