summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-17 07:47:57 +0100
committerRory& <root@rory.gay>2025-12-17 07:47:57 +0100
commit17579462d03b78bbdb39045e8539dadd22307872 (patch)
treee75abb0f0c62b7f4691945adfb4c8b704b3c95c3 /src/api
parentPrettier 4 (diff)
downloadserver-ts-17579462d03b78bbdb39045e8539dadd22307872.tar.xz
Prettier 5
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/guild-recommendations.ts5
-rw-r--r--src/api/routes/guilds/#guild_id/members/#member_id/nick.ts5
-rw-r--r--src/api/routes/hub-waitlist.ts5
-rw-r--r--src/api/routes/users/@me/disable.ts5
-rw-r--r--src/api/routes/users/@me/notes.ts5
-rw-r--r--src/api/util/utility/captcha.ts5
6 files changed, 6 insertions, 24 deletions
diff --git a/src/api/routes/guild-recommendations.ts b/src/api/routes/guild-recommendations.ts

index dcd512e5..fa642ea4 100644 --- a/src/api/routes/guild-recommendations.ts +++ b/src/api/routes/guild-recommendations.ts
@@ -38,10 +38,7 @@ router.get( const { limit } = req.query; const showAllGuilds = Config.get().guild.discovery.showAllGuilds; - const genLoadId = (size: number) => - [...Array(size)] - .map(() => Math.floor(Math.random() * 16).toString(16)) - .join(""); + const genLoadId = (size: number) => [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join(""); const guilds = showAllGuilds ? await Guild.find({ take: Math.abs(Number(limit || 24)) }) diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts b/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts
index 5c72429b..2a707771 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/nick.ts
@@ -41,10 +41,7 @@ router.patch( async (req: Request, res: Response) => { const { guild_id } = req.params; let permissionString: PermissionResolvable = "MANAGE_NICKNAMES"; - const member_id = - req.params.member_id === "@me" - ? ((permissionString = "CHANGE_NICKNAME"), req.user_id) - : req.params.member_id; + const member_id = req.params.member_id === "@me" ? ((permissionString = "CHANGE_NICKNAME"), req.user_id) : req.params.member_id; const perms = await getPermission(req.user_id, guild_id); perms.hasThrow(permissionString); diff --git a/src/api/routes/hub-waitlist.ts b/src/api/routes/hub-waitlist.ts
index 2d21ad63..bdf09311 100644 --- a/src/api/routes/hub-waitlist.ts +++ b/src/api/routes/hub-waitlist.ts
@@ -17,10 +17,7 @@ */ import { route } from "@spacebar/api"; -import { - HubWaitlistSignupResponse, - HubWaitlistSignupSchema, -} from "@spacebar/schemas"; +import { HubWaitlistSignupResponse, HubWaitlistSignupSchema } from "@spacebar/schemas"; import { Request, Response, Router } from "express"; const router = Router({ mergeParams: true }); diff --git a/src/api/routes/users/@me/disable.ts b/src/api/routes/users/@me/disable.ts
index 07e06055..73de8395 100644 --- a/src/api/routes/users/@me/disable.ts +++ b/src/api/routes/users/@me/disable.ts
@@ -45,10 +45,7 @@ router.post( if (user.data.hash) { // guest accounts can delete accounts without password - correctpass = await bcrypt.compare( - req.body.password, - user.data.hash, - ); //Not sure if user typed right password :/ + correctpass = await bcrypt.compare(req.body.password, user.data.hash); //Not sure if user typed right password :/ } if (correctpass) { diff --git a/src/api/routes/users/@me/notes.ts b/src/api/routes/users/@me/notes.ts
index e468c36f..4969fa75 100644 --- a/src/api/routes/users/@me/notes.ts +++ b/src/api/routes/users/@me/notes.ts
@@ -79,10 +79,7 @@ router.put( }, }) ) { - Note.update( - { owner: { id: owner.id }, target: { id: target.id } }, - { owner, target, content: note }, - ); + Note.update({ owner: { id: owner.id }, target: { id: target.id } }, { owner, target, content: note }); } else { Note.insert({ id: Snowflake.generate(), diff --git a/src/api/util/utility/captcha.ts b/src/api/util/utility/captcha.ts
index 3f654a48..f6d4d0e1 100644 --- a/src/api/util/utility/captcha.ts +++ b/src/api/util/utility/captcha.ts
@@ -46,10 +46,7 @@ export async function verifyCaptcha(response: string, ip?: string) { const { security } = Config.get(); const { service, secret, sitekey } = security.captcha; - if (!service || !secret || !sitekey) - throw new Error( - "CAPTCHA is not configured correctly. https://docs.spacebar.chat/setup/server/security/captcha/", - ); + if (!service || !secret || !sitekey) throw new Error("CAPTCHA is not configured correctly. https://docs.spacebar.chat/setup/server/security/captcha/"); const res = await fetch(verifyEndpoints[service], { method: "POST",