mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: join owner, template, and org in new workspace view (#15116)
Joins in fields like `username`, `avatar_url`, `organization_name`, `template_name` to `workspaces` via a **view**. The view must be maintained moving forward, but this prevents needing to add RBAC permissions to fetch related workspace fields.
This commit is contained in:
@ -106,7 +106,7 @@ func New(opts Options) *API {
|
||||
if err != nil {
|
||||
return uuid.Nil, err
|
||||
}
|
||||
return ws.Workspace.ID, nil
|
||||
return ws.ID, nil
|
||||
},
|
||||
}
|
||||
|
||||
@ -231,9 +231,9 @@ func (a *API) workspaceID(ctx context.Context, agent *database.WorkspaceAgent) (
|
||||
}
|
||||
|
||||
a.mu.Lock()
|
||||
a.cachedWorkspaceID = getWorkspaceAgentByIDRow.Workspace.ID
|
||||
a.cachedWorkspaceID = getWorkspaceAgentByIDRow.ID
|
||||
a.mu.Unlock()
|
||||
return getWorkspaceAgentByIDRow.Workspace.ID, nil
|
||||
return getWorkspaceAgentByIDRow.ID, nil
|
||||
}
|
||||
|
||||
func (a *API) publishWorkspaceUpdate(ctx context.Context, agent *database.WorkspaceAgent) error {
|
||||
|
Reference in New Issue
Block a user