diff --git a/src/routes/invites/index.ts b/src/routes/invites/index.ts index c40fb0af..df74e216 100644 --- a/src/routes/invites/index.ts +++ b/src/routes/invites/index.ts @@ -22,6 +22,9 @@ router.delete("/:invite_code", async (req: Request, res: Response) => { const perms = await getPermission(req.user_id, guild_id, channel_id); if (!perms.has("MANAGE_GUILD") || !perms.has("MANAGE_CHANNELS")) throw new HTTPError("You aren't allow", 401); + + await InviteModel.deleteOne({ code }).exec(); + res.status(200).send({ invite: toObject(invite) }); });