Skip to content

Commit 05ba886

Browse files
committed
Merge branch 'main' into asher/binary-verification
2 parents 022e832 + a75342a commit 05ba886

File tree

5 files changed

+198
-183
lines changed

5 files changed

+198
-183
lines changed

src/api-helper.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { isApiError, isApiErrorResponse } from "coder/site/src/api/errors";
2-
import { Workspace, WorkspaceAgent } from "coder/site/src/api/typesGenerated";
2+
import {
3+
Workspace,
4+
WorkspaceAgent,
5+
WorkspaceResource,
6+
} from "coder/site/src/api/typesGenerated";
37
import { ErrorEvent } from "eventsource";
48
import { z } from "zod";
59

@@ -27,12 +31,14 @@ export function extractAllAgents(
2731
workspaces: readonly Workspace[],
2832
): WorkspaceAgent[] {
2933
return workspaces.reduce((acc, workspace) => {
30-
return acc.concat(extractAgents(workspace));
34+
return acc.concat(extractAgents(workspace.latest_build.resources));
3135
}, [] as WorkspaceAgent[]);
3236
}
3337

34-
export function extractAgents(workspace: Workspace): WorkspaceAgent[] {
35-
return workspace.latest_build.resources.reduce((acc, resource) => {
38+
export function extractAgents(
39+
resources: readonly WorkspaceResource[],
40+
): WorkspaceAgent[] {
41+
return resources.reduce((acc, resource) => {
3642
return acc.concat(resource.agents || []);
3743
}, [] as WorkspaceAgent[]);
3844
}

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