summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-02 21:17:52 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-02 21:17:52 +1000
commita599e1ac57d394e7edd4d52f17005589306ba477 (patch)
treee36316488c8a23a98c5f02368cba6d4e02b2c75c
parentApply Iratu's patch for relationships (diff)
downloadserver-a599e1ac57d394e7edd4d52f17005589306ba477.tar.xz
...try again
-rw-r--r--api/src/routes/channels/#channel_id/messages/index.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/api/src/routes/channels/#channel_id/messages/index.ts b/api/src/routes/channels/#channel_id/messages/index.ts
index fc0f88bb..1faf9a3b 100644
--- a/api/src/routes/channels/#channel_id/messages/index.ts
+++ b/api/src/routes/channels/#channel_id/messages/index.ts
@@ -123,15 +123,11 @@ router.get("/", async (req: Request, res: Response) => {
 			MoreThan((BigInt(around) - BigInt(halfLimit)).toString()),
 			LessThan((BigInt(around) + BigInt(halfLimit)).toString())
 		];
-	}
 
-	let messages;
-	try {
-		messages = await Message.find(query);
-	}
-	catch (e) {
 		return res.json([]);
 	}
+
+	const messages = await Message.find(query);
 	const endpoint = Config.get().cdn.endpointPublic;
 
 	return res.json(