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
1 changed files with 5 additions and 1 deletions

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()
}