summary refs log tree commit diff
path: root/src/api/routes/guilds/#guild_id/welcome-screen.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/guilds/#guild_id/welcome-screen.ts')
-rw-r--r--src/api/routes/guilds/#guild_id/welcome-screen.ts21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/api/routes/guilds/#guild_id/welcome-screen.ts b/src/api/routes/guilds/#guild_id/welcome-screen.ts
index 81000b4b..74565a13 100644
--- a/src/api/routes/guilds/#guild_id/welcome-screen.ts
+++ b/src/api/routes/guilds/#guild_id/welcome-screen.ts
@@ -17,12 +17,7 @@
 */
 
 import { route } from "@spacebar/api";
-import {
-	Channel,
-	Guild,
-	GuildUpdateWelcomeScreenSchema,
-	Member,
-} from "@spacebar/util";
+import { Channel, Guild, GuildUpdateWelcomeScreenSchema, Member } from "@spacebar/util";
 import { Request, Response, Router } from "express";
 
 const router: Router = Router();
@@ -46,7 +41,7 @@ router.get(
 		await Member.IsInGuildOrFail(req.user_id, guild_id);
 
 		res.json(guild.welcome_screen);
-	},
+	}
 );
 
 router.patch(
@@ -70,11 +65,9 @@ router.patch(
 
 		const guild = await Guild.findOneOrFail({ where: { id: guild_id } });
 
-		if (body.enabled != undefined)
-			guild.welcome_screen.enabled = body.enabled;
+		if (body.enabled != undefined) guild.welcome_screen.enabled = body.enabled;
 
-		if (body.description != undefined)
-			guild.welcome_screen.description = body.description;
+		if (body.description != undefined) guild.welcome_screen.description = body.description;
 
 		if (body.welcome_channels != undefined) {
 			// Ensure channels exist within the guild
@@ -83,8 +76,8 @@ router.patch(
 					Channel.findOneOrFail({
 						where: { id: channel_id, guild_id },
 						select: { id: true },
-					}),
-				) || [],
+					})
+				) || []
 			);
 			guild.welcome_screen.welcome_channels = body.welcome_channels;
 		}
@@ -92,7 +85,7 @@ router.patch(
 		await guild.save();
 
 		res.status(200).json(guild.welcome_screen);
-	},
+	}
 );
 
 export default router;