summary refs log tree commit diff
path: root/api/src/routes
diff options
context:
space:
mode:
authorxnacly <matteogropp@protonmail.com>2021-09-03 21:33:25 +0200
committerxnacly <matteogropp@protonmail.com>2021-09-03 21:33:25 +0200
commit78f348ea0b3bf53bc7bfca8a234ecf09e296f56f (patch)
tree2f08cd5ddd84e2529d1a66a2859619663b2b46f7 /api/src/routes
parentadded ban check to `Member.addToGuild` (diff)
downloadserver-78f348ea0b3bf53bc7bfca8a234ecf09e296f56f.tar.xz
replace '@me' with req.user_id in guild join
Diffstat (limited to 'api/src/routes')
-rw-r--r--api/src/routes/guilds/#guild_id/members/#member_id/index.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/api/src/routes/guilds/#guild_id/members/#member_id/index.ts b/api/src/routes/guilds/#guild_id/members/#member_id/index.ts
index 66c508a2..7e79caad 100644
--- a/api/src/routes/guilds/#guild_id/members/#member_id/index.ts
+++ b/api/src/routes/guilds/#guild_id/members/#member_id/index.ts
@@ -51,7 +51,8 @@ router.patch("/", check(MemberChangeSchema), async (req: Request, res: Response)
 });
 
 router.put("/", async (req: Request, res: Response) => {
-	const { guild_id, member_id } = req.params;
+	let { guild_id, member_id } = req.params;
+	if (member_id === "@me") member_id = req.user_id;
 
 	throw new HTTPError("Maintenance: Currently you can't add a member", 403);
 	// TODO: only for oauth2 applications