summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2024-06-05 15:17:20 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2024-06-05 15:17:20 +1000
commita3a28f522f7c8639c8b1a2911fa178207b74d52f (patch)
tree3c824a1eba067c1778f2ce4396bdde40aec50e7a /src/api
parentFix lint: let -> const (diff)
downloadserver-ts-a3a28f522f7c8639c8b1a2911fa178207b74d52f.tar.xz
prettier
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/guilds/#guild_id/bans.ts2
-rw-r--r--src/api/routes/guilds/#guild_id/bulk-ban.ts16
-rw-r--r--src/api/util/handlers/route.ts4
3 files changed, 15 insertions, 7 deletions
diff --git a/src/api/routes/guilds/#guild_id/bans.ts b/src/api/routes/guilds/#guild_id/bans.ts

index 5d580ebeb..5ae9bdb9b 100644 --- a/src/api/routes/guilds/#guild_id/bans.ts +++ b/src/api/routes/guilds/#guild_id/bans.ts
@@ -109,7 +109,7 @@ router.get( const banInfo = { user: await User.getPublicUser(ban.user_id), reason: ban.reason, - } + }; return res.json(banInfo); }, diff --git a/src/api/routes/guilds/#guild_id/bulk-ban.ts b/src/api/routes/guilds/#guild_id/bulk-ban.ts
index 47e7c4cb2..f544103a5 100644 --- a/src/api/routes/guilds/#guild_id/bulk-ban.ts +++ b/src/api/routes/guilds/#guild_id/bulk-ban.ts
@@ -51,10 +51,12 @@ router.post( const { guild_id } = req.params; const userIds: Array<string> = req.body.user_ids; - if (!userIds) - throw new HTTPError("The user_ids array is missing", 400); + if (!userIds) throw new HTTPError("The user_ids array is missing", 400); if (userIds.length > 200) - throw new HTTPError("The user_ids array must be between 1 and 200 in length", 400); + throw new HTTPError( + "The user_ids array must be between 1 and 200 in length", + 400, + ); const banned_users = []; const failed_users = []; @@ -116,8 +118,12 @@ router.post( } } - if (banned_users.length === 0 && failed_users.length > 0) throw DiscordApiErrors.BULK_BAN_FAILED; - return res.json({ banned_users: banned_users, failed_users: failed_users }); + if (banned_users.length === 0 && failed_users.length > 0) + throw DiscordApiErrors.BULK_BAN_FAILED; + return res.json({ + banned_users: banned_users, + failed_users: failed_users, + }); }, ); diff --git a/src/api/util/handlers/route.ts b/src/api/util/handlers/route.ts
index fb2b444f0..2c98783a4 100644 --- a/src/api/util/handlers/route.ts +++ b/src/api/util/handlers/route.ts
@@ -96,7 +96,9 @@ export function route(opts: RouteOptions) { req.params.channel_id, ); - const requiredPerms = Array.isArray(opts.permission) ? opts.permission : [opts.permission]; + const requiredPerms = Array.isArray(opts.permission) + ? opts.permission + : [opts.permission]; requiredPerms.forEach((perm) => { // bitfield comparison: check if user lacks certain permission if (!req.permission!.has(new Permissions(perm))) {