1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 05:02:37 +01:00

Update welcome_screen.ts

This commit is contained in:
Intevel ツ 2021-05-08 15:01:16 +02:00
parent 8918103884
commit 643f0c9723

View File

@ -28,7 +28,7 @@ router.post("/", check(GuildAddChannelToWelcomeScreenSchema), async (req: Reques
...body
}
if(guild.welcome_screen.welcome_channels.some(channel => channel.channel_id === body.channel_id)){
if(guild.welcome_screen.welcome_channels.some(channel => channel.channel_id === body.channel_id)) throw new Error("Welcome Channel exists")
await GuildModel.findOneAndUpdate(
@ -38,7 +38,7 @@ router.post("/", check(GuildAddChannelToWelcomeScreenSchema), async (req: Reques
{ $push: { "welcome_screen.welcome_channels": channelObject } }
).exec();
res.json(toObject(guild.welcome_screen));
res.sendStatus(204);
});