diff options
author | xnacly <matteogropp@protonmail.com> | 2021-09-03 21:33:25 +0200 |
---|---|---|
committer | xnacly <matteogropp@protonmail.com> | 2021-09-03 21:33:25 +0200 |
commit | 78f348ea0b3bf53bc7bfca8a234ecf09e296f56f (patch) | |
tree | 2f08cd5ddd84e2529d1a66a2859619663b2b46f7 /api/src/routes | |
parent | added ban check to `Member.addToGuild` (diff) | |
download | server-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.ts | 3 |
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 |