mirror of
https://github.com/strapi/strapi.git
synced 2025-07-31 12:55:08 +00:00
Fixes #1704
This commit is contained in:
parent
fb07e39a38
commit
ef59452b9a
@ -240,7 +240,7 @@ function setAttributeFormData(hash) {
|
|||||||
const type = formType === 'number' ? 'integer' : formType;
|
const type = formType === 'number' ? 'integer' : formType;
|
||||||
let defaultValue = type === 'number' ? 0 : '';
|
let defaultValue = type === 'number' ? 0 : '';
|
||||||
|
|
||||||
if (type === 'checkbox') {
|
if (type === 'boolean') {
|
||||||
defaultValue = false;
|
defaultValue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,6 @@ export function* submitChanges(action) {
|
|||||||
try {
|
try {
|
||||||
// Show button loader
|
// Show button loader
|
||||||
yield put(setButtonLoader());
|
yield put(setButtonLoader());
|
||||||
|
|
||||||
const modelName = get(storeData.getContentType(), 'name');
|
const modelName = get(storeData.getContentType(), 'name');
|
||||||
const data = yield select(makeSelectModel());
|
const data = yield select(makeSelectModel());
|
||||||
const body = cloneDeep(data);
|
const body = cloneDeep(data);
|
||||||
@ -83,7 +82,7 @@ export function* submitChanges(action) {
|
|||||||
set(body.attributes[index].params, 'plugin', true);
|
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;
|
const paramsKey = includes(key, 'Value') ? replace(key,'Value', '') : key;
|
||||||
unset(body.attributes[index].params, paramsKey);
|
unset(body.attributes[index].params, paramsKey);
|
||||||
}
|
}
|
||||||
@ -99,7 +98,6 @@ export function* submitChanges(action) {
|
|||||||
const baseUrl = '/content-type-builder/models/';
|
const baseUrl = '/content-type-builder/models/';
|
||||||
const requestUrl = method === 'POST' ? baseUrl : `${baseUrl}${body.name}`;
|
const requestUrl = method === 'POST' ? baseUrl : `${baseUrl}${body.name}`;
|
||||||
const opts = { method, body };
|
const opts = { method, body };
|
||||||
|
|
||||||
const response = yield call(request, requestUrl, opts, true);
|
const response = yield call(request, requestUrl, opts, true);
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user