fix message loading
This commit is contained in:
parent
11d65e42be
commit
3c9e48cbda
@ -71,9 +71,11 @@ router.get("/", async (req, res) => {
|
|||||||
id: { $gt: (BigInt(around) - BigInt(halfLimit)).toString(), $lt: (BigInt(around) + BigInt(halfLimit)).toString() }
|
id: { $gt: (BigInt(around) - BigInt(halfLimit)).toString(), $lt: (BigInt(around) + BigInt(halfLimit)).toString() }
|
||||||
});
|
});
|
||||||
else {
|
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();
|
const messages = await query.limit(limit).exec();
|
||||||
|
|
||||||
return res.json(
|
return res.json(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user