Skip to content

Commit

Permalink
Merge pull request #51 from indec-it/fix/buildYupSchemaNumber
Browse files Browse the repository at this point in the history
fix(buildYupSchema): check value type
  • Loading branch information
maximilianoforlenza authored Mar 2, 2023
2 parents 8be4ca4 + d8f6181 commit 759b036
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@indec/form-builder",
"version": "1.7.1",
"version": "1.7.2",
"description": "Form builder",
"main": "index.js",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/buildYupSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 759b036

Please sign in to comment.