diff --git a/packages/scandipwa/src/util/Form/Extract.ts b/packages/scandipwa/src/util/Form/Extract.ts index 1e95df0d54..7589ec0484 100644 --- a/packages/scandipwa/src/util/Form/Extract.ts +++ b/packages/scandipwa/src/util/Form/Extract.ts @@ -286,7 +286,7 @@ export const getFieldsData = ( : field.value; const dateValue = field.getAttribute('data-date'); - const formattedValue = dateValue ? getDateValue(dateValue) : value || ''; + const formattedValue = dateValue ? getDateValue(dateValue) : value; if (!excludeEmpty || value) { output.push({ diff --git a/packages/scandipwa/src/util/Form/Form.type.ts b/packages/scandipwa/src/util/Form/Form.type.ts index 4d158f4ad5..e387e37d5c 100644 --- a/packages/scandipwa/src/util/Form/Form.type.ts +++ b/packages/scandipwa/src/util/Form/Form.type.ts @@ -57,4 +57,4 @@ export type GetFieldsData = AsObject extends t export type FieldValue< T = unknown, isUnknownValue = true, -> = isUnknownValue extends true ? string | number | boolean | Date : T; +> = isUnknownValue extends true ? string | number | boolean | undefined | Date : T;