summary refs log tree commit diff
diff options
context:
space:
mode:
authorIntevel ツ <59223342+Intevel@users.noreply.github.com>2021-05-08 15:10:12 +0200
committerIntevel ツ <59223342+Intevel@users.noreply.github.com>2021-05-08 15:10:12 +0200
commite5f731ba97353b9a8602713dab144f4f85291c64 (patch)
treee60f09c1af69acb625290d5e0fe63e4629f5222e
parentUpdate welcome_screen.ts (diff)
downloadserver-e5f731ba97353b9a8602713dab144f4f85291c64.tar.xz
Update welcome_screen.ts
-rw-r--r--src/routes/guilds/#guild_id/welcome_screen.ts3
1 files changed, 1 insertions, 2 deletions
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");