Fix saving checked value of custom select or radio

[MAILPOET-2643]
This commit is contained in:
Rostislav Wolny
2020-01-14 16:29:22 +01:00
committed by Pavel Dohnal
parent 5bb6dcd6be
commit 22332b4735

View File

@@ -19,7 +19,13 @@ function mapFormDataToParams(fieldType, data) {
case 'select':
return {
required: data.mandatory ? '1' : undefined,
values: data.values.map((value) => ({ value: value.name })),
values: data.values.map((value) => {
const mapped = { value: value.name };
if (value.isChecked) {
mapped.is_checked = '1';
}
return mapped;
}),
};
case 'text':
return {