diff options
author | The Arcane Brony <myrainbowdash949@gmail.com> | 2021-12-22 17:43:39 +0000 |
---|---|---|
committer | The Arcane Brony <myrainbowdash949@gmail.com> | 2021-12-22 18:43:39 +0100 |
commit | a9a92ff2cb3f9668d7a3d5b025bc20753a4c934c (patch) | |
tree | dc98592046563ed486c9a5ebd18d2618d769b59b /api | |
parent | Improve build scripts, strip more fs-extras (diff) | |
download | server-a9a92ff2cb3f9668d7a3d5b025bc20753a4c934c.tar.xz |
Add Sentry, fix compile errors
Diffstat (limited to 'api')
-rw-r--r-- | api/package.json | 2 | ||||
-rw-r--r-- | api/src/routes/channels/#channel_id/messages/index.ts | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/api/package.json b/api/package.json index 9701e12d..ab41b675 100644 --- a/api/package.json +++ b/api/package.json @@ -65,6 +65,8 @@ "@babel/preset-env": "^7.15.8", "@babel/preset-typescript": "^7.15.0", "@fosscord/util": "file:../util", + "@sentry/node": "^6.16.1", + "@sentry/tracing": "^6.16.1", "ajv": "8.6.2", "ajv-formats": "^2.1.1", "amqplib": "^0.8.0", 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; |