1
0
Fork 0
mirror of synced 2024-06-02 18:44:54 +12:00

Use nullable

This commit is contained in:
Mel O'Hagan 2022-10-27 14:45:30 +01:00
parent a9f6a11fdd
commit 31d9e2b1bf

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