From 4d027a424e442f10371d205e68aa3bf63d0eba0e Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Fri, 8 Sep 2023 21:33:04 -0400 Subject: Implement Pomelo Registration --- src/api/routes/users/@me/index.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/api/routes/users/@me') diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts index f4578126..55d2ce12 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts @@ -172,10 +172,7 @@ router.patch( } // check if username is already taken (pomelo only) - const userCount = await User.count({ - where: { username: body.username }, - }); - if (userCount > 0) { + if (!User.isUsernameAvailable(body.username)) throw FieldErrors({ username: { code: "USERNAME_ALREADY_TAKEN", @@ -184,7 +181,6 @@ router.patch( ), }, }); - } } // handle username changes (old username system) -- cgit 1.5.1