Change value for disabling in custom field form mapping
[MAILPOET-3381]
This commit is contained in:
@@ -2,23 +2,23 @@ function mapFormDataToParams(fieldType, data) {
|
|||||||
switch (fieldType) {
|
switch (fieldType) {
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
return {
|
return {
|
||||||
required: data.mandatory ? '1' : undefined,
|
required: data.mandatory ? '1' : '',
|
||||||
values: [{
|
values: [{
|
||||||
is_checked: data.isChecked ? '1' : undefined,
|
is_checked: data.isChecked ? '1' : '',
|
||||||
value: data.checkboxLabel,
|
value: data.checkboxLabel,
|
||||||
}],
|
}],
|
||||||
};
|
};
|
||||||
case 'date':
|
case 'date':
|
||||||
return {
|
return {
|
||||||
required: data.mandatory ? '1' : undefined,
|
required: data.mandatory ? '1' : '',
|
||||||
date_type: data.dateType,
|
date_type: data.dateType,
|
||||||
date_format: data.dateFormat,
|
date_format: data.dateFormat,
|
||||||
is_default_today: data.defaultToday ? '1' : undefined,
|
is_default_today: data.defaultToday ? '1' : '',
|
||||||
};
|
};
|
||||||
case 'radio':
|
case 'radio':
|
||||||
case 'select':
|
case 'select':
|
||||||
return {
|
return {
|
||||||
required: data.mandatory ? '1' : undefined,
|
required: data.mandatory ? '1' : '',
|
||||||
values: data.values.map((value) => {
|
values: data.values.map((value) => {
|
||||||
const mapped = { value: value.name };
|
const mapped = { value: value.name };
|
||||||
if (value.isChecked) {
|
if (value.isChecked) {
|
||||||
@@ -29,12 +29,12 @@ function mapFormDataToParams(fieldType, data) {
|
|||||||
};
|
};
|
||||||
case 'text':
|
case 'text':
|
||||||
return {
|
return {
|
||||||
required: data.mandatory ? '1' : undefined,
|
required: data.mandatory ? '1' : '',
|
||||||
validate: data.validate,
|
validate: data.validate,
|
||||||
};
|
};
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
return {
|
return {
|
||||||
required: data.mandatory ? '1' : undefined,
|
required: data.mandatory ? '1' : '',
|
||||||
validate: data.validate,
|
validate: data.validate,
|
||||||
lines: data.lines ? data.lines : '1',
|
lines: data.lines ? data.lines : '1',
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user