summary refs log tree commit diff
path: root/src/routes
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-26 13:30:10 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-26 13:30:10 +0200
commit3c9e48cbda52c7abc252abe0c948708fdeddbcdc (patch)
tree02f70df445c7c7f45c106df750271aa451b32755 /src/routes
parentnpm i @fosscord/server-util@1.3.3 (diff)
downloadserver-3c9e48cbda52c7abc252abe0c948708fdeddbcdc.tar.xz
fix message loading
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/channels/#channel_id/messages/index.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/routes/channels/#channel_id/messages/index.ts b/src/routes/channels/#channel_id/messages/index.ts

index 7fdff809..cdc46d14 100644 --- a/src/routes/channels/#channel_id/messages/index.ts +++ b/src/routes/channels/#channel_id/messages/index.ts
@@ -71,9 +71,11 @@ router.get("/", async (req, res) => { id: { $gt: (BigInt(around) - BigInt(halfLimit)).toString(), $lt: (BigInt(around) + BigInt(halfLimit)).toString() } }); else { - query = MessageModel.find({ channel_id }).sort({ id: -1 }); + query = MessageModel.find({ channel_id }); } + query = query.sort({ id: -1 }); + const messages = await query.limit(limit).exec(); return res.json(