summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authordank074 <torresefrain10@gmail.com>2024-11-19 14:19:40 -0600
committerdank074 <torresefrain10@gmail.com>2024-11-19 14:19:40 -0600
commitf5d6394c38285161d35ba4fbece9b116bd33c700 (patch)
tree01b420a21f7ce8a3064a296155ebdc70da1fdf80 /src/api
parentbuild(deps): update npm dependencies hash [dependabot skip] (diff)
downloadserver-ts-f5d6394c38285161d35ba4fbece9b116bd33c700.tar.xz
run prettier
Diffstat (limited to 'src/api')
-rw-r--r--src/api/Server.ts3
-rw-r--r--src/api/routes/auth/generate-registration-tokens.ts2
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts2
-rw-r--r--src/api/routes/channels/#channel_id/typing.ts2
-rw-r--r--src/api/routes/discoverable-guilds.ts8
-rw-r--r--src/api/routes/guild-recommendations.ts2
-rw-r--r--src/api/routes/oauth2/authorize.ts2
7 files changed, 10 insertions, 11 deletions
diff --git a/src/api/Server.ts b/src/api/Server.ts

index 27adc0bd..b4274969 100644 --- a/src/api/Server.ts +++ b/src/api/Server.ts
@@ -100,8 +100,7 @@ export class SpacebarServer extends Server { this.app.set("json replacer", JSONReplacer); const trustedProxies = Config.get().security.trustedProxies; - if(trustedProxies) - this.app.set("trust proxy", trustedProxies); + if (trustedProxies) this.app.set("trust proxy", trustedProxies); this.app.use(CORS); this.app.use(BodyParser({ inflate: true, limit: "10mb" })); diff --git a/src/api/routes/auth/generate-registration-tokens.ts b/src/api/routes/auth/generate-registration-tokens.ts
index 50c389e0..dbe2dab4 100644 --- a/src/api/routes/auth/generate-registration-tokens.ts +++ b/src/api/routes/auth/generate-registration-tokens.ts
@@ -72,7 +72,7 @@ router.get( `${Config.get().general.frontPage}/register?token=${ x.token }`, - ) + ) : tokens.map((x) => x.token); if (req.query.plain) return res.send(ret.join("\n")); diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts
index 521ab7a1..4ba28927 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -417,7 +417,7 @@ router.post( ? Member.update( { id: req.user_id, guild_id: message.guild_id }, { last_message_id: message.id }, - ) + ) : null, channel.save(), ]); diff --git a/src/api/routes/channels/#channel_id/typing.ts b/src/api/routes/channels/#channel_id/typing.ts
index 90e78175..bb8d4897 100644 --- a/src/api/routes/channels/#channel_id/typing.ts +++ b/src/api/routes/channels/#channel_id/typing.ts
@@ -54,7 +54,7 @@ router.post( ...member, roles: member?.roles?.map((x) => x.id), }, - } + } : null), channel_id, timestamp, diff --git a/src/api/routes/discoverable-guilds.ts b/src/api/routes/discoverable-guilds.ts
index b8c6a386..781affe7 100644 --- a/src/api/routes/discoverable-guilds.ts +++ b/src/api/routes/discoverable-guilds.ts
@@ -42,24 +42,24 @@ router.get( guilds = showAllGuilds ? await Guild.find({ take: Math.abs(Number(limit || configLimit)), - }) + }) : await Guild.find({ where: { features: Like(`%DISCOVERABLE%`) }, take: Math.abs(Number(limit || configLimit)), - }); + }); } else { guilds = showAllGuilds ? await Guild.find({ where: { primary_category_id: categories.toString() }, take: Math.abs(Number(limit || configLimit)), - }) + }) : await Guild.find({ where: { primary_category_id: categories.toString(), features: Like("%DISCOVERABLE%"), }, take: Math.abs(Number(limit || configLimit)), - }); + }); } const total = guilds ? guilds.length : undefined; diff --git a/src/api/routes/guild-recommendations.ts b/src/api/routes/guild-recommendations.ts
index 876780df..3ac31680 100644 --- a/src/api/routes/guild-recommendations.ts +++ b/src/api/routes/guild-recommendations.ts
@@ -48,7 +48,7 @@ router.get( : await Guild.find({ where: { features: Like("%DISCOVERABLE%") }, take: Math.abs(Number(limit || 24)), - }); + }); res.send({ recommended_guilds: guilds, load_id: `server_recs/${genLoadId(32)}`, diff --git a/src/api/routes/oauth2/authorize.ts b/src/api/routes/oauth2/authorize.ts
index 2f2351f3..63f403a1 100644 --- a/src/api/routes/oauth2/authorize.ts +++ b/src/api/routes/oauth2/authorize.ts
@@ -118,7 +118,7 @@ router.get( guild: { roles: x?.roles || [], }, - }); + }); return { id: x.guild.id,