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)
|