invite right enforced

This commit is contained in:
Erkin Alp Güney 2022-04-08 11:34:01 +03:00 committed by GitHub
parent 20e1f6394e
commit a8c57a878d

View File

@ -19,7 +19,8 @@ export interface InviteCreateSchema {
target_user_type?: number; target_user_type?: number;
} }
router.post("/", route({ body: "InviteCreateSchema", permission: "CREATE_INSTANT_INVITE" }), async (req: Request, res: Response) => { router.post("/", route({ body: "InviteCreateSchema", permission: "CREATE_INSTANT_INVITE", right: "CREATE_INSTANT_INVITE" }),
async (req: Request, res: Response) => {
const { user_id } = req; const { user_id } = req;
const { channel_id } = req.params; const { channel_id } = req.params;
const channel = await Channel.findOneOrFail({ where: { id: channel_id }, select: ["id", "name", "type", "guild_id"] }); const channel = await Channel.findOneOrFail({ where: { id: channel_id }, select: ["id", "name", "type", "guild_id"] });