fix: set DESC order

This commit is contained in:
CyberL1 2025-09-29 10:17:42 +02:00 committed by Rory&
parent 9662b587e3
commit 6bf4109465
2 changed files with 4 additions and 0 deletions

View File

@ -58,6 +58,7 @@ router.put(
const pinned_count = await Message.count({
where: { channel: { id: channel_id }, pinned_at: Not(IsNull()) },
order: { pinned_at: "DESC" },
});
const { maxPins } = Config.get().limits.channel;
@ -184,6 +185,7 @@ router.get(
const pins = await Message.find({
where: { channel_id: channel_id, pinned_at: Not(IsNull()) },
relations: ["author"],
order: { pinned_at: "DESC" },
});
const items = pins.map((message: Message) => ({

View File

@ -59,6 +59,7 @@ router.put(
const pinned_count = await Message.count({
where: { channel: { id: channel_id }, pinned_at: Not(IsNull()) },
order: { pinned_at: "DESC" },
});
const { maxPins } = Config.get().limits.channel;
@ -185,6 +186,7 @@ router.get(
const pins = await Message.find({
where: { channel_id: channel_id, pinned_at: Not(IsNull()) },
relations: ["author"],
order: { pinned_at: "DESC" },
});
res.send(pins);