1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 05:02:37 +01:00

fix message loading

This commit is contained in:
Flam3rboy 2021-05-26 13:30:10 +02:00
parent 11d65e42be
commit 3c9e48cbda

View File

@ -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(