summary refs log tree commit diff
path: root/api/src
diff options
context:
space:
mode:
authorChris Chrome <christophercookman@gmail.com>2021-12-26 13:38:25 -0500
committerGitHub <noreply@github.com>2021-12-26 13:38:25 -0500
commit78b33a8b7a56caac8b460daa63a2f48d7c8b5549 (patch)
tree4d72614aef511f0e44be20d425dfae79a56dce1e /api/src
parentFix the casing (diff)
parentAdd env name in sentry, set default sentry endpoint (diff)
downloadserver-78b33a8b7a56caac8b460daa63a2f48d7c8b5549.tar.xz
Merge pull request #553 from TheArcaneBrony/master
Remove fs-extras, add Sentry support, fix compile errors, fix some typos
Diffstat (limited to 'api/src')
-rw-r--r--api/src/Server.ts2
-rw-r--r--api/src/routes/channels/#channel_id/messages/index.ts8
2 files changed, 5 insertions, 5 deletions
diff --git a/api/src/Server.ts b/api/src/Server.ts

index 259c2a6b..b0683dfc 100644 --- a/api/src/Server.ts +++ b/api/src/Server.ts
@@ -12,7 +12,7 @@ import { initTranslation } from "./middlewares/Translation"; import morgan from "morgan"; import { initInstance } from "./util/Instance"; import { registerRoutes } from "@fosscord/util"; -import { red } from "nanocolors" +import { red } from "picocolors" export interface FosscordServerOptions extends ServerOptions {} diff --git a/api/src/routes/channels/#channel_id/messages/index.ts b/api/src/routes/channels/#channel_id/messages/index.ts
index d3c0a409..b2fb615c 100644 --- a/api/src/routes/channels/#channel_id/messages/index.ts +++ b/api/src/routes/channels/#channel_id/messages/index.ts
@@ -107,7 +107,7 @@ router.get("/", async (req: Request, res: Response) => { const endpoint = Config.get().cdn.endpointPublic; return res.json( - messages.map((x) => { + messages.map((x: any) => { (x.reactions || []).forEach((x: any) => { // @ts-ignore if ((x.user_ids || []).includes(req.user_id)) x.me = true; @@ -116,10 +116,10 @@ router.get("/", async (req: Request, res: Response) => { }); // @ts-ignore if (!x.author) x.author = { discriminator: "0000", username: "Deleted User", public_flags: "0", avatar: null }; - x.attachments?.forEach((x) => { + x.attachments?.forEach((y: any) => { // dynamically set attachment proxy_url in case the endpoint changed - const uri = x.proxy_url.startsWith("http") ? x.proxy_url : `https://example.org${x.proxy_url}`; - x.proxy_url = `${endpoint == null ? "" : endpoint}${new URL(uri).pathname}`; + const uri = y.proxy_url.startsWith("http") ? y.proxy_url : `https://example.org${y.proxy_url}`; + y.proxy_url = `${endpoint == null ? "" : endpoint}${new URL(uri).pathname}`; }); return x;