1
0
Fork 0
mirror of synced 2024-10-02 18:16:29 +13:00

Handle object type in validation (#12619)

This commit is contained in:
melohagan 2024-01-03 09:54:18 +00:00 committed by GitHub
parent 0b21c36526
commit 8a44c24021
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
import { string, number } from "yup"
import { string, number, object } from "yup"
const propertyValidator = type => {
if (type === "number") {
@ -9,6 +9,10 @@ const propertyValidator = type => {
return string().email().nullable()
}
if (type === "object") {
return object().nullable()
}
return string().nullable()
}