Skip to content

Commit 50638c7

Browse files
committed
populate sdk workspace
1 parent 81a8aa2 commit 50638c7

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

coderd/database/dbauthz/dbauthz_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func TestNew(t *testing.T) {
123123

124124
w, err := az.GetWorkspaceByID(ctx, exp.ID)
125125
require.NoError(t, err, "must not error")
126-
require.Equal(t, exp, w, "must be equal")
126+
require.Equal(t, exp, w.WorkspaceTable(), "must be equal")
127127

128128
rec.AssertActor(t, subj, rec.Pair(policy.ActionRead, exp))
129129
require.NoError(t, rec.AllAsserted(), "should only be 1 rbac call")

coderd/database/modelmethods.go

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -413,21 +413,31 @@ func ConvertWorkspaceRows(rows []GetWorkspacesRow) []Workspace {
413413
workspaces := make([]Workspace, len(rows))
414414
for i, r := range rows {
415415
workspaces[i] = Workspace{
416-
ID: r.ID,
417-
CreatedAt: r.CreatedAt,
418-
UpdatedAt: r.UpdatedAt,
419-
OwnerID: r.OwnerID,
420-
OrganizationID: r.OrganizationID,
421-
TemplateID: r.TemplateID,
422-
Deleted: r.Deleted,
423-
Name: r.Name,
424-
AutostartSchedule: r.AutostartSchedule,
425-
Ttl: r.Ttl,
426-
LastUsedAt: r.LastUsedAt,
427-
DormantAt: r.DormantAt,
428-
DeletingAt: r.DeletingAt,
429-
AutomaticUpdates: r.AutomaticUpdates,
430-
Favorite: r.Favorite,
416+
ID: r.ID,
417+
CreatedAt: r.CreatedAt,
418+
UpdatedAt: r.UpdatedAt,
419+
OwnerID: r.OwnerID,
420+
OrganizationID: r.OrganizationID,
421+
TemplateID: r.TemplateID,
422+
Deleted: r.Deleted,
423+
Name: r.Name,
424+
AutostartSchedule: r.AutostartSchedule,
425+
Ttl: r.Ttl,
426+
LastUsedAt: r.LastUsedAt,
427+
DormantAt: r.DormantAt,
428+
DeletingAt: r.DeletingAt,
429+
AutomaticUpdates: r.AutomaticUpdates,
430+
Favorite: r.Favorite,
431+
OwnerAvatarUrl: r.OwnerAvatarUrl,
432+
OwnerUsername: r.OwnerUsername,
433+
OrganizationName: r.OrganizationName,
434+
OrganizationDisplayName: r.OrganizationDisplayName,
435+
OrganizationIcon: r.OrganizationIcon,
436+
OrganizationDescription: r.OrganizationDescription,
437+
TemplateName: r.TemplateName,
438+
TemplateDisplayName: r.TemplateDisplayName,
439+
TemplateIcon: r.TemplateIcon,
440+
TemplateDescription: r.TemplateDescription,
431441
}
432442
}
433443

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy