From 95bbccb6f723264e514618b18d1af9e3679e0e6d Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Sat, 17 Aug 2024 18:24:38 +0200 Subject: [PATCH] Same error message if username too long --- src/api/routes/auth/register.ts | 4 ++-- src/api/routes/users/@me/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/routes/auth/register.ts b/src/api/routes/auth/register.ts index ea5de53b..62152440 100644 --- a/src/api/routes/auth/register.ts +++ b/src/api/routes/auth/register.ts @@ -291,8 +291,8 @@ router.post( if (body.username.length > maxUsername) { throw FieldErrors({ username: { - code: "USERNAME_INVALID", - message: `Username must be less than ${maxUsername} in length`, + code: "BASE_TYPE_BAD_LENGTH", + message: `Must be between 2 and ${maxUsername} in length.`, }, }); } diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts index 5caf0d11..9cd8bfda 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts @@ -155,8 +155,8 @@ router.patch( if (check_username.length > maxUsername) { throw FieldErrors({ username: { - code: "USERNAME_INVALID", - message: `Username must be less than ${maxUsername} in length`, + code: "BASE_TYPE_BAD_LENGTH", + message: `Must be between 2 and ${maxUsername} in length.`, }, }); }