From ed37ce6aebad19b8357b65d1fef570ec4cd6d747 Mon Sep 17 00:00:00 2001 From: VLE2FE Date: Thu, 27 Aug 2020 15:46:27 +0200 Subject: [PATCH] filter fix --- src/routes/validate/sample.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/validate/sample.ts b/src/routes/validate/sample.ts index 9c5ad0d..54f7bb4 100644 --- a/src/routes/validate/sample.ts +++ b/src/routes/validate/sample.ts @@ -209,7 +209,7 @@ export default class SampleValidate { if (/material\./.test(field)) { // select right validation model validator = MaterialValidate.outputV().append({ number: Joi.string().max(128).allow(''), - properties: Joi.alternatives().try(Joi.number(), Joi.string().max(128)) + properties: Joi.alternatives().try(Joi.number(), Joi.string().max(128).allow('')) }); field = field.replace('material.', '').split('.')[0]; } @@ -218,7 +218,7 @@ export default class SampleValidate { value: Joi.alternatives() .try( Joi.number(), - Joi.string().max(128), + Joi.string().max(128).allow(''), Joi.boolean(), Joi.array() )