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 => {
|
const propertyValidator = type => {
|
||||||
if (type === "number") {
|
if (type === "number") {
|
||||||
|
@ -9,6 +9,10 @@ const propertyValidator = type => {
|
||||||
return string().email().nullable()
|
return string().email().nullable()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === "object") {
|
||||||
|
return object().nullable()
|
||||||
|
}
|
||||||
|
|
||||||
return string().nullable()
|
return string().nullable()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue