add transformation rules
This commit is contained in:
parent
d9982d9206
commit
13feb970b0
1 changed files with 6 additions and 0 deletions
|
@ -21,6 +21,9 @@ export const SubmitTrollSchema = yup
|
||||||
.matches(/^[A-z]+$/, "Letters only")
|
.matches(/^[A-z]+$/, "Letters only")
|
||||||
.max(24)
|
.max(24)
|
||||||
.lowercase()
|
.lowercase()
|
||||||
|
.transform(v => {
|
||||||
|
return v.length <= 0 ? undefined : v;
|
||||||
|
})
|
||||||
])
|
])
|
||||||
.required(),
|
.required(),
|
||||||
description: yup.string().max(10000).ensure(),
|
description: yup.string().max(10000).ensure(),
|
||||||
|
@ -38,6 +41,9 @@ export const SubmitTrollSchema = yup
|
||||||
.matches(/^[A-z-]+$/, "Letters only")
|
.matches(/^[A-z-]+$/, "Letters only")
|
||||||
.lowercase()
|
.lowercase()
|
||||||
.max(50)
|
.max(50)
|
||||||
|
.transform(v => {
|
||||||
|
return v.length <= 0 ? undefined : v;
|
||||||
|
})
|
||||||
])
|
])
|
||||||
.required(),
|
.required(),
|
||||||
pronouns: yup
|
pronouns: yup
|
||||||
|
|
Loading…
Reference in a new issue