Skip to content

Commit d0cf454

Browse files
committed
somethin'
1 parent b5424ad commit d0cf454

File tree

11 files changed

+113
-122
lines changed

11 files changed

+113
-122
lines changed

coderd/apidoc/docs.go

Lines changed: 0 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: 0 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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,11 @@ func Group(group database.Group, members []database.GroupMember, totalMemberCoun
222222
}
223223
}
224224

225-
func GroupWithOrganizationInfo(group database.Group, orgDisplayName string, members []database.GroupMember, totalMemberCount int) codersdk.GroupWithOrganizationInfo {
225+
func GroupWithOrganizationInfo(group database.Group, orgName, orgDisplayName string, members []database.GroupMember, totalMemberCount int) codersdk.GroupWithOrganizationInfo {
226226
sdkGroup := Group(group, members, totalMemberCount)
227227
return codersdk.GroupWithOrganizationInfo{
228228
Group: sdkGroup,
229+
OrganizationName: orgName,
229230
OrganizationDisplayName: orgDisplayName,
230231
}
231232
}

coderd/database/queries.sql.go

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

coderd/database/queries/groups.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ LIMIT
2222

2323
-- name: GetGroups :many
2424
SELECT
25-
sqlc.embed(groups), organizations.display_name AS organization_display_name
25+
sqlc.embed(groups),
26+
organizations.name AS organization_name,
27+
organizations.display_name AS organization_display_name
2628
FROM
2729
groups
2830
INNER JOIN

coderd/telemetry/telemetry.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ func (r *remoteReporter) createSnapshot() (*Snapshot, error) {
373373
}
374374
snapshot.Groups = make([]Group, 0, len(groups))
375375
for _, group := range groups {
376-
snapshot.Groups = append(snapshot.Groups, ConvertGroup(group))
376+
snapshot.Groups = append(snapshot.Groups, ConvertGroup(group.Group))
377377
}
378378
return nil
379379
})
@@ -669,15 +669,15 @@ func ConvertUser(dbUser database.User) User {
669669
}
670670
}
671671

672-
func ConvertGroup(row database.GetGroupsRow) Group {
672+
func ConvertGroup(group database.Group) Group {
673673
return Group{
674-
ID: row.Group.ID,
675-
Name: row.Group.Name,
676-
OrganizationID: row.Group.OrganizationID,
677-
AvatarURL: row.Group.AvatarURL,
678-
QuotaAllowance: row.Group.QuotaAllowance,
679-
DisplayName: row.Group.DisplayName,
680-
Source: row.Group.Source,
674+
ID: group.ID,
675+
Name: group.Name,
676+
OrganizationID: group.OrganizationID,
677+
AvatarURL: group.AvatarURL,
678+
QuotaAllowance: group.QuotaAllowance,
679+
DisplayName: group.DisplayName,
680+
Source: group.Source,
681681
}
682682
}
683683

codersdk/groups.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ type CreateGroupRequest struct {
2626
}
2727

2828
type Group struct {
29-
ID uuid.UUID `json:"id" format:"uuid"`
30-
Name string `json:"name"`
31-
DisplayName string `json:"display_name"`
32-
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
33-
OrganizationDisplayName string `json:"organization_display_name"`
34-
Members []ReducedUser `json:"members"`
29+
ID uuid.UUID `json:"id" format:"uuid"`
30+
Name string `json:"name"`
31+
DisplayName string `json:"display_name"`
32+
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
33+
Members []ReducedUser `json:"members"`
3534
// How many members are in this group. Shows the total count,
3635
// even if the user is not authorized to read group member details.
3736
// May be greater than `len(Group.Members)`.
@@ -43,6 +42,7 @@ type Group struct {
4342

4443
type GroupWithOrganizationInfo struct {
4544
Group
45+
OrganizationName string `json:"organization_name"`
4646
OrganizationDisplayName string `json:"organization_display_name"`
4747
}
4848

0 commit comments

Comments
 (0)