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
commitf7de3c6c0fa945e54cbecb6ecd09ac8c281abaf9 (patch)
tree746adb4696661bc98b7d60c6f461d2802b12df3c
parentApply Iratu's patch for relationships (diff)
downloadserver-f7de3c6c0fa945e54cbecb6ecd09ac8c281abaf9.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(