From 246e80c09588f9be2b85c7b1a40c230d63d67c93 Mon Sep 17 00:00:00 2001 From: Cyber Date: Tue, 3 Sep 2024 14:13:52 +0200 Subject: [PATCH] fix: self nick change response --- .../guilds/#guild_id/members/#member_id/nick.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts b/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts index 7b8e44d3..5e2bdfe2 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts @@ -27,7 +27,9 @@ router.patch( route({ requestBody: "MemberNickChangeSchema", responses: { - 200: {}, + 200: { + body: "APIPublicMember", + }, 400: { body: "APIErrorResponse", }, @@ -48,7 +50,13 @@ router.patch( perms.hasThrow(permissionString); await Member.changeNickname(member_id, guild_id, req.body.nick); - res.status(200).send(); + + const member = await Member.findOne({ + where: { id: member_id, guild_id }, + relations: ["roles"], + }); + + res.send(member?.toPublicMember()); }, );