diff options
Diffstat (limited to 'api/src')
-rw-r--r-- | api/src/routes/guilds/#guild_id/members/#member_id/nick.ts | 4 | ||||
-rw-r--r-- | api/src/util/Member.ts | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/api/src/routes/guilds/#guild_id/members/#member_id/nick.ts b/api/src/routes/guilds/#guild_id/members/#member_id/nick.ts index 9078409d..77b8d72a 100644 --- a/api/src/routes/guilds/#guild_id/members/#member_id/nick.ts +++ b/api/src/routes/guilds/#guild_id/members/#member_id/nick.ts @@ -17,8 +17,8 @@ router.patch("/", check(MemberNickChangeSchema), async (req: Request, res: Respo const perms = await getPermission(req.user_id, guild_id); perms.hasThrow(permissionString); - await changeNickname(member_id, guild_id, req.body.nickname); - res.status(204); + await changeNickname(member_id, guild_id, req.body.nick); + res.status(200).send(); }); export default router; diff --git a/api/src/util/Member.ts b/api/src/util/Member.ts index 7b06720b..316d3f75 100644 --- a/api/src/util/Member.ts +++ b/api/src/util/Member.ts @@ -196,6 +196,7 @@ export async function removeRole(user_id: string, guild_id: string, role_id: str export async function changeNickname(user_id: string, guild_id: string, nickname: string) { const user = await getPublicUser(user_id); + var memberObj = await MemberModel.findOneAndUpdate( { id: user_id, |