fix: Paginate attachments API (#11044)

There are attachments with over 1000 attachments (unusual) in
production, and some of them timeout. This PR would limit the number of
attachments to 100 (which is sufficient for viewing the files in the
gallery, pagination on the UI can be added later).
This commit is contained in:
Pranav
2025-03-07 13:56:10 -08:00
committed by GitHub
parent 08f0ea2c98
commit 22331fb626
2 changed files with 15 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
json.meta do
json.total_count @attachments_count
end
json.payload @attachments do |attachment|
json.message_id attachment.push_event_data[:message_id]
json.thumb_url attachment.push_event_data[:thumb_url]