summary refs log tree commit diff
diff options
context:
space:
mode:
authorxnacly <matteogropp@gmail.com>2021-04-17 13:49:03 +0100
committerxnacly <matteogropp@gmail.com>2021-04-17 13:49:03 +0100
commit4aafcb569aa492ac159931a183dc8c4b95dc117b (patch)
treefe180a6f423ab79ce59a2f4316e38f7f56523706
parent:bug: fix port not picking up env file (diff)
downloadserver-4aafcb569aa492ac159931a183dc8c4b95dc117b.tar.xz
fixed missing db delete call
-rw-r--r--src/routes/invites/index.ts3
1 files changed, 3 insertions, 0 deletions
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) }); });