summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorCyberL1 <cyber.hf18@gmail.com>2025-09-29 10:17:42 +0200
committerRory& <root@rory.gay>2025-09-29 18:32:21 +0200
commit6bf4109465311dc04b2aa50f38dbd79e83e820d9 (patch)
treeea0f42c100615e150dfe754e081c9ccba588120e /src/api
parentfix: update `pinned` column value in down migration (diff)
downloadserver-ts-6bf4109465311dc04b2aa50f38dbd79e83e820d9.tar.xz
fix: set DESC order
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/channels/#channel_id/messages/pins/index.ts2
-rw-r--r--src/api/routes/channels/#channel_id/pins.ts2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/pins/index.ts b/src/api/routes/channels/#channel_id/messages/pins/index.ts

index 651a140e2..da8ba8425 100644 --- a/src/api/routes/channels/#channel_id/messages/pins/index.ts +++ b/src/api/routes/channels/#channel_id/messages/pins/index.ts
@@ -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) => ({ diff --git a/src/api/routes/channels/#channel_id/pins.ts b/src/api/routes/channels/#channel_id/pins.ts
index c45c8853c..8c4ee10d2 100644 --- a/src/api/routes/channels/#channel_id/pins.ts +++ b/src/api/routes/channels/#channel_id/pins.ts
@@ -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);