Commit 3e89831
authored
fix(community): eliminate per-member role API calls on members tab (#1079)
## Summary
- `CommunityMemberCard` was calling `communityUserRoles` (a
`entityRoles` API call) for each member individually
- With 350 members, this resulted in 350 simultaneous requests,
triggering HTTP 429 "Too many requests"
- The roles are already present in the `communityUsersWithRoles`
response - they are now passed as a prop, removing all redundant calls
## Changes
- `CommunityMemberCard`: removed `communityUserRoles` query, accepts
`roles: CommunityUserRole[]` as prop instead
- `members.tsx`: passes `member.roles` (already fetched) to each card
## Test plan
- [x] Go to a community with many members (e.g. `/community/4/members`)
- [x] Verify the member list loads fully without 429 errors
- [x] Verify role badges (member / administrator) still display
correctly on each card
Closes #10781 parent c7d8263 commit 3e89831
2 files changed
Lines changed: 4 additions & 11 deletions
File tree
- app/(general)/community/(general)/[id]/[tab]
- components/user
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | 45 | | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
10 | 9 | | |
11 | 10 | | |
12 | | - | |
13 | 11 | | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
20 | 16 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 17 | | |
25 | 18 | | |
26 | 19 | | |
| |||
0 commit comments