Merge pull request #8423 from Budibase/bug/sev3/datasource-validation

Datasource validation - use nullable to avoid type error
This commit is contained in:
Martin McKeaveney 2022-10-31 10:36:11 +00:00 committed by GitHub
commit c1fd94689f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -28,15 +28,13 @@ export const createValidationStore = () => {
let propertyValidator
switch (type) {
case "number":
propertyValidator = number().transform(value =>
isNaN(value) ? undefined : value
)
propertyValidator = number().nullable()
break
case "email":
propertyValidator = string().email()
propertyValidator = string().email().nullable()
break
default:
propertyValidator = string()
propertyValidator = string().nullable()
}
if (required) {