Fix previous commit
This commit is contained in:
parent
0a26b7baf2
commit
39e1a4d136
@ -15,7 +15,7 @@ router.get("/:code", route({}), async (req: Request, res: Response) => {
|
||||
|
||||
router.post("/:code", route({}), async (req: Request, res: Response) => {
|
||||
const { code } = req.params;
|
||||
const { features } = await Guild.findOneOrFail({where: { code }});
|
||||
const { features } = await Guild.findOneOrFail({ id: (await Invite.findOneOrFail({ code })).guild_id});
|
||||
const { public_flags } = await User.findOneOrFail({ id: req.user_id });
|
||||
|
||||
if(features.includes("INTERNAL_EMPLOYEE_ONLY") && (public_flags & 1) !== 1) throw new HTTPError("You are not allowed to join this guild.", 401)
|
||||
|
Loading…
x
Reference in New Issue
Block a user