From b77eed221f9e5fc657234a6de3e11c27f4de3d38 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 11 Oct 2025 11:38:28 +0300 Subject: [PATCH] Fix count of Orgs Teams People at Admin Panel. Thanks to xet7 ! --- client/components/settings/peopleBody.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js index ee0e0b927..622155d61 100644 --- a/client/components/settings/peopleBody.js +++ b/client/components/settings/peopleBody.js @@ -203,26 +203,35 @@ BlazeComponent.extendComponent({ this.loading.set(w); }, orgList() { + const limitOrgs = this.page.get() * orgsPerPage; const orgs = ReactiveCache.getOrgs(this.findOrgsOptions.get(), { sort: { orgDisplayName: 1 }, + limit: limitOrgs, fields: { _id: true }, }); + // Count only the items currently loaded to browser, not total from database this.numberOrgs.set(orgs.length); return orgs; }, teamList() { + const limitTeams = this.page.get() * teamsPerPage; const teams = ReactiveCache.getTeams(this.findTeamsOptions.get(), { sort: { teamDisplayName: 1 }, + limit: limitTeams, fields: { _id: true }, }); + // Count only the items currently loaded to browser, not total from database this.numberTeams.set(teams.length); return teams; }, peopleList() { + const limitUsers = this.page.get() * usersPerPage; const users = ReactiveCache.getUsers(this.findUsersOptions.get(), { sort: { username: 1 }, + limit: limitUsers, fields: { _id: true }, }); + // Count only the items currently loaded to browser, not total from database this.numberPeople.set(users.length); return users; },