mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-13 14:12:41 +01:00
fixed missing db delete call
This commit is contained in:
parent
9d848bf3a9
commit
4aafcb569a
@ -22,6 +22,9 @@ router.delete("/:invite_code", async (req: Request, res: Response) => {
|
|||||||
const perms = await getPermission(req.user_id, guild_id, channel_id);
|
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);
|
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) });
|
res.status(200).send({ invite: toObject(invite) });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user