Skip to content

Conversation

@mcull
Copy link
Owner

@mcull mcull commented Sep 29, 2025

Summary

Align library member counts across API endpoints to include only active users. This fixes inflated counts on library cards and collection views.

Changes

  • Filter members with and where counts are calculated.
  • Ensure consistency in:

    • Admin collections listing
    • Join flow response metadata

Why

Member counts previously included inactive users, leading to confusing totals on the library card and detail pages.

Impact

  • Displayed member counts now reflect active members only.
  • No schema changes; purely query-level adjustments.

Test Plan

  • Create a collection with N members and deactivate one user membership; verify count decrements.
  • Compare counts between library cards, discover list, and collection detail — they should match.

mcull and others added 2 commits September 28, 2025 23:45
Library cards were displaying inflated member counts by including inactive users in the totals. This update ensures accurate member count display across all API endpoints by filtering `_count.members` queries for `{ isActive: true }`.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Resolved double-counting issue where member counts were inconsistent between endpoints. The root cause was that `members` relation queries filtered by both `isActive: true` and `user: { status: 'active' }`, but `_count.members` queries only filtered by `isActive: true`.

Updated all `_count.members` queries to consistently filter for active members with active user accounts, ensuring accurate member counts across all library cards and API responses.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Sep 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
stufflibrary Ready Ready Preview Comment Sep 29, 2025 8:08am

@mcull mcull merged commit 6f47bdd into main Oct 21, 2025
4 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.

2 participants