Skip to content

Commit 2409072

Browse files
committed
rename ReducedGroup.member_count to ReducedGroup.total_member_count
1 parent 2c6d037 commit 2409072

File tree

7 files changed

+42
-37
lines changed

7 files changed

+42
-37
lines changed

coderd/apidoc/docs.go

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/db2sdk/db2sdk.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@ func Group(group database.Group, members []database.User) codersdk.Group {
192192
}
193193
}
194194

195-
func ReducedGroup(group database.Group, memberCount int) codersdk.ReducedGroup {
195+
func ReducedGroup(group database.Group, totalMemberCount int) codersdk.ReducedGroup {
196196
return codersdk.ReducedGroup{
197-
ID: group.ID,
198-
Name: group.Name,
199-
DisplayName: group.DisplayName,
200-
OrganizationID: group.OrganizationID,
201-
AvatarURL: group.AvatarURL,
202-
MemberCount: memberCount,
197+
ID: group.ID,
198+
Name: group.Name,
199+
DisplayName: group.DisplayName,
200+
OrganizationID: group.OrganizationID,
201+
AvatarURL: group.AvatarURL,
202+
TotalMemberCount: totalMemberCount,
203203
}
204204
}
205205

codersdk/groups.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ type ReducedGroup struct {
4040
Name string `json:"name"`
4141
DisplayName string `json:"display_name"`
4242
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
43-
MemberCount int `json:"member_count"`
44-
AvatarURL string `json:"avatar_url"`
43+
// How many users are in this group. Shows the total count,
44+
// even if the user is not authorized to read group member details.
45+
// May be greater than `len(Group.Members)`.
46+
TotalMemberCount int `json:"total_member_count"`
47+
AvatarURL string `json:"avatar_url"`
4548
}
4649

4750
func (g Group) IsEveryone() bool {

docs/api/enterprise.md

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/schemas.md

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/api/typesGenerated.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)