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 | 1211e486f98127e6d259867a50fc1ad1a2007358 (patch) | |
tree | 590e63aee4ed7647b6a7dd4d02960bae2fbb7d1e | |
parent | added ban check to `Member.addToGuild` (diff) | |
download | server-1211e486f98127e6d259867a50fc1ad1a2007358.tar.xz |
replace '@me' with req.user_id in guild join
-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 |