From e5f731ba97353b9a8602713dab144f4f85291c64 Mon Sep 17 00:00:00 2001 From: Intevel ツ <59223342+Intevel@users.noreply.github.com> Date: Sat, 8 May 2021 15:10:12 +0200 Subject: Update welcome_screen.ts --- src/routes/guilds/#guild_id/welcome_screen.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/routes') diff --git a/src/routes/guilds/#guild_id/welcome_screen.ts b/src/routes/guilds/#guild_id/welcome_screen.ts index ff25b37c..8fc5ac39 100644 --- a/src/routes/guilds/#guild_id/welcome_screen.ts +++ b/src/routes/guilds/#guild_id/welcome_screen.ts @@ -15,7 +15,7 @@ router.get("/", async (req: Request, res: Response) => { const guild = await GuildModel.findOne({ id: guild_id }); if (!guild) throw new HTTPError("Guild not found", 404); - if(!isMember(req.user_id, guild_id)) throw new HTTPError("You are not member of this guild", 403); + await isMember(req.user_id, guild_id); res.json(toObject(guild.welcome_screen)); }); @@ -31,7 +31,6 @@ router.post("/", check(GuildAddChannelToWelcomeScreenSchema), async (req: Reques ...body } - if(!isMember(req.user_id, guild_id)) throw new HTTPError("You are not member of this guild", 403); const perms = await getPermission(req.user_id, guild_id); perms.hasThrow("MANAGE_GUILD"); -- cgit 1.4.1