summary refs log tree commit diff
path: root/src/api/routes/users/@me
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@protonmail.com>2023-09-08 21:33:04 -0400
committerPuyodead1 <puyodead@protonmail.com>2023-12-23 16:38:15 -0500
commit4d027a424e442f10371d205e68aa3bf63d0eba0e (patch)
treecfce10a0f47f497ce89f4f18ec31cc685cb2941a /src/api/routes/users/@me
parentupdate user modify for unique usernames (diff)
downloadserver-ts-4d027a424e442f10371d205e68aa3bf63d0eba0e.tar.xz
Implement Pomelo Registration
Diffstat (limited to 'src/api/routes/users/@me')
-rw-r--r--src/api/routes/users/@me/index.ts6
1 files changed, 1 insertions, 5 deletions
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)