chore: refactor workspace count to single route (#4809)

Co-authored-by: Presley Pizzo <presley@coder.com>
This commit is contained in:
Garrett Delfosse
2022-11-10 13:25:46 -05:00
committed by GitHub
parent 5fb9c33ecd
commit 766a2ad590
23 changed files with 160 additions and 761 deletions

View File

@ -70,7 +70,7 @@ type sshWorkspaceConfig struct {
}
func sshFetchWorkspaceConfigs(ctx context.Context, client *codersdk.Client) ([]sshWorkspaceConfig, error) {
workspaces, err := client.Workspaces(ctx, codersdk.WorkspaceFilter{
res, err := client.Workspaces(ctx, codersdk.WorkspaceFilter{
Owner: codersdk.Me,
})
if err != nil {
@ -78,8 +78,8 @@ func sshFetchWorkspaceConfigs(ctx context.Context, client *codersdk.Client) ([]s
}
var errGroup errgroup.Group
workspaceConfigs := make([]sshWorkspaceConfig, len(workspaces))
for i, workspace := range workspaces {
workspaceConfigs := make([]sshWorkspaceConfig, len(res.Workspaces))
for i, workspace := range res.Workspaces {
i := i
workspace := workspace
errGroup.Go(func() error {