From b634e6a691423ffe24150675c38ce0f5dcd69135 Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Sun, 17 Dec 2023 12:47:59 -0500 Subject: [PATCH] implement admin guild member delete --- .../admin/guilds/#guild_id/members/index.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/api/routes/admin/guilds/#guild_id/members/index.ts b/src/api/routes/admin/guilds/#guild_id/members/index.ts index b87065dad..c2a224748 100644 --- a/src/api/routes/admin/guilds/#guild_id/members/index.ts +++ b/src/api/routes/admin/guilds/#guild_id/members/index.ts @@ -70,4 +70,26 @@ router.get( }, ); +router.delete( + "/", + route({ + description: "Remove a member from a guild", + right: "ADMIN_DELETE_MEMBERS", + responses: { + 204: {}, + 400: { + body: "APIErrorResponse", + }, + 404: { + body: "APIErrorResponse", + }, + }, + }), + async (req: Request, res: Response) => { + const { guild_id, member_id } = req.params; + await Member.removeFromGuild(member_id, guild_id); + res.sendStatus(204); + }, +); + export default router;