Skip to content

feat: add search and cursor based pagination to userAdminRouter.list - #30026

Open
SinghaAnirban005 wants to merge 2 commits into
calcom:mainfrom
SinghaAnirban005:feat/search
Open

feat: add search and cursor based pagination to userAdminRouter.list#30026
SinghaAnirban005 wants to merge 2 commits into
calcom:mainfrom
SinghaAnirban005:feat/search

Conversation

@SinghaAnirban005

@SinghaAnirban005 SinghaAnirban005 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR resolves the TODO: Add search, pagination, etc. in userAdminRouter.list (packages/trpc/server/routers/viewer/users/_router.ts), which previously called prisma.user.findMany() unfiltered and unpaginated fetching all users on every call.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs if this PR makes changes that would require a documentation change. N/A
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @SinghaAnirban005! Thanks for opening this pull request.

A few things to keep in mind:

  • This is Cal.diy, not Cal.com. Cal.diy is a community-driven, fully open-source fork of Cal.com licensed under MIT. Your changes here will be part of Cal.diy — they will not be deployed to the Cal.com production app.
  • Please review our Contributing Guidelines if you haven't already.
  • Make sure your PR title follows the Conventional Commits format.

A maintainer will review your PR soon. Thanks for contributing!

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 55b94851-e023-42f7-94b6-ead6e06507ad

📥 Commits

Reviewing files that changed from the base of the PR and between 176037d and db9d2ee.

📒 Files selected for processing (3)
  • packages/trpc/server/routers/viewer/users/_router.test.ts
  • packages/trpc/server/routers/viewer/users/_router.ts
  • packages/trpc/server/routers/viewer/users/listUsers.schema.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The user admin listing endpoint now validates pagination and search inputs. It uses the user repository for search and cursor-based pagination. The response contains user rows, the next cursor, and total-row metadata. Tests cover authenticated setup, default pagination, search-term handling, cursor and limit forwarding, row mapping, and response metadata.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding search and cursor-based pagination to userAdminRouter.list.
Description check ✅ Passed The description accurately explains the pagination and search changes, the previous unpaginated behavior, and the included tests.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant