Handle object type in validation (#12619)
This commit is contained in:
parent
0b21c36526
commit
8a44c24021
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue