From 1211e486f98127e6d259867a50fc1ad1a2007358 Mon Sep 17 00:00:00 2001 From: xnacly Date: Fri, 3 Sep 2021 21:33:25 +0200 Subject: replace '@me' with req.user_id in guild join --- api/src/routes/guilds/#guild_id/members/#member_id/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'api/src/routes/guilds') 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 -- cgit 1.4.1