From d8f6181fed50e7808ba735c351d256bfc94391f1 Mon Sep 17 00:00:00 2001 From: Maximiliano forlenza Date: Thu, 2 Mar 2023 10:39:38 -0300 Subject: [PATCH] fix(buildYupSchema): check value type --- package.json | 2 +- src/utils/buildYupSchema.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a0dbb5b..501f81f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@indec/form-builder", - "version": "1.7.1", + "version": "1.7.2", "description": "Form builder", "main": "index.js", "private": false, diff --git a/src/utils/buildYupSchema.js b/src/utils/buildYupSchema.js index 95cd492..ca9663b 100644 --- a/src/utils/buildYupSchema.js +++ b/src/utils/buildYupSchema.js @@ -56,7 +56,7 @@ const handleValidations = ({validator, validations, type, opts}) => { const newParams = []; const isCheckboxRequired = validationType === 'required' && type === questionTypes.CHECKBOX; validation.params.forEach(param => { - if (param.value || isCheckboxRequired) { + if (typeof param.value === 'number' || param.value || isCheckboxRequired) { newParams.push(isCheckboxRequired ? 1 : param.value, param.message); } else { newParams.push(param.message);