1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 13:14:06 +01:00

Update welcome_screen.ts

This commit is contained in:
Intevel ツ 2021-05-08 15:10:12 +02:00
parent e3ce017aed
commit e5f731ba97

View File

@ -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");