mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-20 15:26:15 +08:00
fixed incorrect validation message being shown
This commit is contained in:
parent
574ff0538c
commit
948f667b2a
|
@ -460,12 +460,14 @@ const profileDetailsBase = joi
|
|||
.string()
|
||||
.allow("")
|
||||
.custom((value, helpers) => {
|
||||
return containsProfanity(value)
|
||||
? helpers.error("string.pattern.base")
|
||||
: value;
|
||||
if (containsProfanity(value)) {
|
||||
return helpers.error("string.profanity");
|
||||
}
|
||||
|
||||
return value;
|
||||
})
|
||||
.messages({
|
||||
"string.pattern.base": "Profanity detected. Please remove it.",
|
||||
"string.profanity": "Profanity detected. Please remove it.",
|
||||
});
|
||||
|
||||
router.patch(
|
||||
|
|
Loading…
Reference in a new issue