summary refs log tree commit diff
path: root/src/api/routes/guilds/#guild_id/bans.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/guilds/#guild_id/bans.ts')
-rw-r--r--src/api/routes/guilds/#guild_id/bans.ts25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/api/routes/guilds/#guild_id/bans.ts b/src/api/routes/guilds/#guild_id/bans.ts
index 0776ab62..1fcc6806 100644
--- a/src/api/routes/guilds/#guild_id/bans.ts
+++ b/src/api/routes/guilds/#guild_id/bans.ts
@@ -78,7 +78,7 @@ router.get(
 		});
 
 		return res.json(bansObj);
-	},
+	}
 );
 
 router.get(
@@ -115,7 +115,7 @@ router.get(
 		delete ban.ip;
 
 		return res.json(ban);
-	},
+	}
 );
 
 router.put(
@@ -139,14 +139,8 @@ router.put(
 		const { guild_id } = req.params;
 		const banned_user_id = req.params.user_id;
 
-		if (
-			req.user_id === banned_user_id &&
-			banned_user_id === req.permission?.cache.guild?.owner_id
-		)
-			throw new HTTPError(
-				"You are the guild owner, hence can't ban yourself",
-				403,
-			);
+		if (req.user_id === banned_user_id && banned_user_id === req.permission?.cache.guild?.owner_id)
+			throw new HTTPError("You are the guild owner, hence can't ban yourself", 403);
 
 		if (req.permission?.cache.guild?.owner_id === banned_user_id)
 			throw new HTTPError("You can't ban the owner", 400);
@@ -175,7 +169,7 @@ router.put(
 		]);
 
 		return res.json(ban);
-	},
+	}
 );
 
 router.put(
@@ -200,10 +194,7 @@ router.put(
 		const banned_user = await User.getPublicUser(req.params.user_id);
 
 		if (req.permission?.cache.guild?.owner_id === req.params.user_id)
-			throw new HTTPError(
-				"You are the guild owner, hence can't ban yourself",
-				403,
-			);
+			throw new HTTPError("You are the guild owner, hence can't ban yourself", 403);
 
 		const ban = Ban.create({
 			user_id: req.params.user_id,
@@ -227,7 +218,7 @@ router.put(
 		]);
 
 		return res.json(ban);
-	},
+	}
 );
 
 router.delete(
@@ -273,7 +264,7 @@ router.delete(
 		]);
 
 		return res.status(204).send();
-	},
+	}
 );
 
 export default router;