1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 13:14:06 +01:00

Update members.ts

This commit is contained in:
Intevel ツ 2021-05-08 14:15:46 +02:00
parent f167ceae91
commit 42c3d90898

View File

@ -50,6 +50,8 @@ router.get("/:member_id", async (req: Request, res: Response) => {
router.put("/:member_id", async (req: Request, res: Response) => {
const { guild_id, member_id } = req.params;
throw new HTTPError("Maintenance: Currently you can't add a member", 403)
// TODO: only for oauth2 applications
await addMember(member_id, guild_id);
res.sendStatus(204)
});
@ -58,6 +60,9 @@ router.put("/:member_id", async (req: Request, res: Response) => {
router.delete("/:member_id", async (req: Request, res: Response) => {
const { guild_id, member_id } = req.params;
const perms = await getPermission(req.user_id, guild_id);
perms.hasThrow("KICK_MEMBERS");
await removeMember(member_id, guild_id);
res.sendStatus(204)
});