Skip to content

server/backoffice: paginate files in organization detail pages#8836

Merged
frankie567 merged 4 commits intopolarsource:mainfrom
ged1182:fix/paginate-backoffice-files
Feb 2, 2026
Merged

server/backoffice: paginate files in organization detail pages#8836
frankie567 merged 4 commits intopolarsource:mainfrom
ged1182:fix/paginate-backoffice-files

Conversation

@ged1182
Copy link
Contributor

@ged1182 ged1182 commented Jan 9, 2026

Fixes #8147

The backoffice organization detail pages were loading slowly for organizations with many downloadable files. The root cause was the files section loading all files at once and generating presigned S3 download URLs for each one.

This PR adds pagination to the files section in both v1 and v2 organization detail pages:

  • Add paginate_by_organization method to FileRepository for paginated file queries
  • Update /organizations/{id} endpoint with files_page and files_limit query parameters
  • Update /organizations-v2/{id} endpoint with the same pagination parameters
  • Add pagination UI matching the existing benefits pagination pattern
  • Use anchor fragments (#files) to maintain scroll position when navigating pages

Files are now paginated at 10 per page, significantly reducing the number of presigned URLs generated per request.

@vercel
Copy link

vercel bot commented Jan 9, 2026

@ged1182 is attempting to deploy a commit to the polar-sh Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@frankie567 frankie567 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, that's helpful! Just asking to reuse the existing datatable.pagination helper we have, but otherwise good to go.

ged1182 and others added 4 commits February 2, 2026 20:33
Add a new method to fetch files with pagination support, returning
both the file list and total count. This enables efficient loading
of files for organizations with many downloadable files.
Add pagination to the downloadable files section in the v1 organizations
backoffice page. Files are now loaded 10 per page with Previous/Next
navigation. Includes anchor fragment to maintain scroll position.

Fixes polarsource#8147
Add pagination to the downloadable files section in the v2 organizations
backoffice page. Files are now loaded 10 per page with Previous/Next
navigation. Includes anchor fragment to maintain scroll position.
@frankie567 frankie567 force-pushed the fix/paginate-backoffice-files branch from f4380bb to 70971a3 Compare February 2, 2026 19:43
@frankie567 frankie567 enabled auto-merge (squash) February 2, 2026 19:43
@frankie567 frankie567 merged commit a317acb into polarsource:main Feb 2, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paginate benefits in backoffice to improve loading performance

2 participants