[PR #2109] [MERGED] fix(admin): Fix total in listUsers not using where clause #4158

Closed
opened 2026-03-13 11:34:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2109
Author: @Netrifier
Created: 4/3/2025
Status: Merged
Merged: 4/3/2025
Merged by: @Bekacru

Base: mainHead: fix-admin-listusers-total


📝 Commits (1)

  • 607827b fix(admin): pass where clause to adapter.count function in internalAdapter.countTotalUsers

📊 Changes

3 files changed (+19 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/db/internal-adapter.ts (+2 -1)
📝 packages/better-auth/src/plugins/admin/admin.test.ts (+14 -0)
📝 packages/better-auth/src/plugins/admin/admin.ts (+3 -1)

📄 Description

  • Fixed the total in admin.listUsers to return the correct total after using the where clause
  • Changed internalAdapter.countTotalUsers function to accept an optional where clause
  • Added test

closes #2108


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/2109 **Author:** [@Netrifier](https://github.com/Netrifier) **Created:** 4/3/2025 **Status:** ✅ Merged **Merged:** 4/3/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix-admin-listusers-total` --- ### 📝 Commits (1) - [`607827b`](https://github.com/better-auth/better-auth/commit/607827b2aea41b4e5a056c5c30611d20f2442300) fix(admin): pass where clause to adapter.count function in internalAdapter.countTotalUsers ### 📊 Changes **3 files changed** (+19 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/internal-adapter.ts` (+2 -1) 📝 `packages/better-auth/src/plugins/admin/admin.test.ts` (+14 -0) 📝 `packages/better-auth/src/plugins/admin/admin.ts` (+3 -1) </details> ### 📄 Description - Fixed the total in admin.listUsers to return the correct total after using the where clause - Changed internalAdapter.countTotalUsers function to accept an optional where clause - Added test closes #2108 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 11:34:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#4158