From b6a4c92943c098b9b8d9b5fabb49e92b3d3f002d Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Tue, 22 Oct 2024 17:52:23 +0200 Subject: [PATCH] - fix for fields with value 0; --- src/pages/BandoApplication/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/BandoApplication/index.js b/src/pages/BandoApplication/index.js index 5b3d9a5..aeecfd7 100644 --- a/src/pages/BandoApplication/index.js +++ b/src/pages/BandoApplication/index.js @@ -152,6 +152,7 @@ const BandoApplication = () => { trigger(); const formValues = getValues(); + console.log('formValues', formValues); const usedFieldsIds = pluck('id', formData); const newFormValues = Object.keys(formValues) .filter(v => usedFieldsIds.includes(v)) @@ -164,7 +165,7 @@ const BandoApplication = () => { fieldVal = tzAwareDate.toISOString().substring(0, 19); } - fieldVal = !fieldVal ? null : fieldVal; + fieldVal = isEmpty(fieldVal) ? null : fieldVal; if (formField && formField.name === 'fileupload') { fieldVal = is(Array, fieldVal) ? fieldVal.map(o => o.id).join(',') : null; }