summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorYodozoh <yodozoh@protonmail.com>2026-02-11 00:45:00 +0100
committerRory& <root@rory.gay>2026-02-11 10:30:13 +0100
commitf233fdb9dec36d95951b5e53a1a210083fd14357 (patch)
tree6044a393670b0c91d9b1ea7b793e402665dd6ac6 /src/api
parentsave channel (diff)
downloadserver-ts-f233fdb9dec36d95951b5e53a1a210083fd14357.tar.xz
feat: Add limit query parameter when fetching reactions
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts b/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts

index 88938063..75fd5d27 100644 --- a/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts +++ b/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts
@@ -150,6 +150,7 @@ router.get( }), async (req: Request, res: Response) => { const { message_id, channel_id } = req.params as { [key: string]: string }; + const limit = req.query.limit ? Number(req.query.limit) : 25; const emoji = getEmoji(req.params.emoji as string); const message = await Message.findOneOrFail({ @@ -164,6 +165,7 @@ router.get( id: In(reaction.user_ids), }, select: PublicUserProjection, + take: limit, }) ).map((user) => user.toPublicUser());