Same error message if username too long

This commit is contained in:
TomatoCake 2024-08-17 18:24:38 +02:00
parent 8e28f2539c
commit 95bbccb6f7
2 changed files with 4 additions and 4 deletions

View File

@ -291,8 +291,8 @@ router.post(
if (body.username.length > maxUsername) { if (body.username.length > maxUsername) {
throw FieldErrors({ throw FieldErrors({
username: { username: {
code: "USERNAME_INVALID", code: "BASE_TYPE_BAD_LENGTH",
message: `Username must be less than ${maxUsername} in length`, message: `Must be between 2 and ${maxUsername} in length.`,
}, },
}); });
} }

View File

@ -155,8 +155,8 @@ router.patch(
if (check_username.length > maxUsername) { if (check_username.length > maxUsername) {
throw FieldErrors({ throw FieldErrors({
username: { username: {
code: "USERNAME_INVALID", code: "BASE_TYPE_BAD_LENGTH",
message: `Username must be less than ${maxUsername} in length`, message: `Must be between 2 and ${maxUsername} in length.`,
}, },
}); });
} }