1
0
Fork 0
mirror of synced 2024-06-26 18:10:51 +12:00

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

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) {