Skip to content

Commit c06b399

Browse files
committed
Do not submit empty fields.
1 parent d829a6d commit c06b399

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

frontend/packages/volto-form-block/src/schemaFormBlock/ViewSchemaForm.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
includes,
1414
keys,
1515
map,
16+
omitBy,
1617
pickBy,
1718
without,
1819
isObject,
@@ -115,6 +116,9 @@ const FormBlockView = ({ data, id, properties, metadata, path }) => {
115116
),
116117
);
117118

119+
// Remove empty values
120+
submitData = omitBy(submitData, (value) => value === null);
121+
118122
dispatch(submitForm(path, id, submitData, captcha))
119123
.then((resp) => {
120124
setSubmitted(true);

0 commit comments

Comments
 (0)