mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-24 23:04:00 +08:00
fixed incorrect validation message being shown
This commit is contained in:
parent
574ff0538c
commit
948f667b2a
1 changed files with 6 additions and 4 deletions
|
@ -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