From 4aafcb569aa492ac159931a183dc8c4b95dc117b Mon Sep 17 00:00:00 2001 From: xnacly Date: Sat, 17 Apr 2021 13:49:03 +0100 Subject: [PATCH] fixed missing db delete call --- src/routes/invites/index.ts | 3 +++ 1 file changed, 3 insertions(+) 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) }); });