diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2023-12-11 01:12:54 +0100 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2023-12-11 01:12:54 +0100 |
commit | 0a8ceb9e6349284e75545a01ffad608b020f78e2 (patch) | |
tree | 17a9163f963eddabf9168b0b630096b2f7535b64 /src/api/routes/guilds/#guild_id/bans.ts | |
parent | Prettier: use editorconfig (diff) | |
download | server-dev/emma-refactors.tar.xz |
Actually run prettier dev/emma-refactors
Diffstat (limited to 'src/api/routes/guilds/#guild_id/bans.ts')
-rw-r--r-- | src/api/routes/guilds/#guild_id/bans.ts | 25 |
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; |