From 3e93ad8a879454cfa56b5c9791c345af4f58cea6 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Mon, 29 Sep 2025 10:20:15 +0200 Subject: [PATCH] fix: don't set order for counting queries --- src/api/routes/channels/#channel_id/messages/pins/index.ts | 1 - src/api/routes/channels/#channel_id/pins.ts | 1 - 2 files changed, 2 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 da8ba842..11de9b85 100644 --- a/src/api/routes/channels/#channel_id/messages/pins/index.ts +++ b/src/api/routes/channels/#channel_id/messages/pins/index.ts @@ -58,7 +58,6 @@ 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; diff --git a/src/api/routes/channels/#channel_id/pins.ts b/src/api/routes/channels/#channel_id/pins.ts index 8c4ee10d..188b8ec4 100644 --- a/src/api/routes/channels/#channel_id/pins.ts +++ b/src/api/routes/channels/#channel_id/pins.ts @@ -59,7 +59,6 @@ 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;