@@ -386,13 +386,13 @@ func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Req
386
386
return
387
387
}
388
388
389
- user := database. User {
389
+ owner := workspaceOwner {
390
390
ID : member .UserID ,
391
391
Username : member .Username ,
392
392
AvatarURL : member .AvatarURL ,
393
393
}
394
394
395
- createWorkspace (ctx , aReq , apiKey .UserID , api , user , req , rw , r )
395
+ createWorkspace (ctx , aReq , apiKey .UserID , api , owner , req , rw , r )
396
396
}
397
397
398
398
// Create a new workspace for the currently authenticated user.
@@ -436,15 +436,26 @@ func (api *API) postUserWorkspaces(rw http.ResponseWriter, r *http.Request) {
436
436
return
437
437
}
438
438
439
- createWorkspace (ctx , aReq , apiKey .UserID , api , user , req , rw , r )
439
+ owner := workspaceOwner {
440
+ ID : user .ID ,
441
+ Username : user .Username ,
442
+ AvatarURL : user .AvatarURL ,
443
+ }
444
+ createWorkspace (ctx , aReq , apiKey .UserID , api , owner , req , rw , r )
445
+ }
446
+
447
+ type workspaceOwner struct {
448
+ ID uuid.UUID
449
+ Username string
450
+ AvatarURL string
440
451
}
441
452
442
453
func createWorkspace (
443
454
ctx context.Context ,
444
455
auditReq * audit.Request [database.Workspace ],
445
456
initiatorID uuid.UUID ,
446
457
api * API ,
447
- user database. User ,
458
+ owner workspaceOwner ,
448
459
req codersdk.CreateWorkspaceRequest ,
449
460
rw http.ResponseWriter ,
450
461
r * http.Request ,
0 commit comments