mirror of
https://github.com/strapi/strapi.git
synced 2025-07-30 12:29:30 +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;
|
||||
let defaultValue = type === 'number' ? 0 : '';
|
||||
|
||||
if (type === 'checkbox') {
|
||||
if (type === 'boolean') {
|
||||
defaultValue = false;
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user