diff --git a/api/src/routes/channels/#channel_id/messages/index.ts b/api/src/routes/channels/#channel_id/messages/index.ts
index 54e6edcc..00e38239 100644
--- a/api/src/routes/channels/#channel_id/messages/index.ts
+++ b/api/src/routes/channels/#channel_id/messages/index.ts
@@ -102,12 +102,11 @@ router.get("/", async (req: Request, res: Response) => {
if (!permissions.has("READ_MESSAGE_HISTORY")) return res.json([]);
var query: FindManyOptions<Message> & { where: { id?: any; }; } = {
- order: { id: "DESC" },
+ order: { timestamp: "DESC" },
take: limit,
where: { channel_id },
relations: ["author", "webhook", "application", "mentions", "mention_roles", "mention_channels", "sticker_items", "attachments"]
};
-
if (after) {
if (after > new Snowflake()) return res.status(422);
@@ -179,7 +178,7 @@ const messageUpload = multer({
router.post(
"/",
messageUpload.any(),
- async (req, res, next) => {
+ (req, res, next) => {
if (req.body.payload_json) {
req.body = JSON.parse(req.body.payload_json);
}
@@ -228,7 +227,7 @@ router.post(
const channel_dto = await DmChannelDTO.from(channel);
// Only one recipients should be closed here, since in group DMs the recipient is deleted not closed
- Promise.all(
+ await Promise.all(
channel.recipients!.map((recipient) => {
if (recipient.closed) {
recipient.closed = false;
|