diff --git a/helm-frontend/src/routes/Run.tsx b/helm-frontend/src/routes/Run.tsx index 42cd1396bd..b2c189b1c0 100644 --- a/helm-frontend/src/routes/Run.tsx +++ b/helm-frontend/src/routes/Run.tsx @@ -6,7 +6,6 @@ import { ArrowTopRightOnSquareIcon, } from "@heroicons/react/24/solid"; import getSchema from "@/services/getSchema"; -import getRunSpecs from "@/services/getRunSpecs"; import type RunSpec from "@/types/RunSpec"; import getInstances from "@/services/getInstances"; import type Instance from "@/types/Instance"; @@ -18,7 +17,9 @@ import getScenarioByName from "@/services/getScenarioByName"; import type Scenario from "@/types/Scenario"; import type AdapterFieldMap from "@/types/AdapterFieldMap"; import type MetricFieldMap from "@/types/MetricFieldMap"; -import { getRunSpecByNameUrl } from "@/services/getRunSpecByName"; +import getRunSpecByName, { + getRunSpecByNameUrl, +} from "@/services/getRunSpecByName"; import { getScenarioStateByNameUrl } from "@/services/getScenarioStateByName"; import Tab from "@/components/Tab"; import Tabs from "@/components/Tabs"; @@ -75,7 +76,7 @@ export default function Run() { setRunSuite(suite); const [ - runSpecs, + runSpecResp, instancesResp, statsResp, scenario, @@ -83,7 +84,7 @@ export default function Run() { displayRequests, schema, ] = await Promise.all([ - getRunSpecs(signal), + getRunSpecByName(runName, signal, suite), getInstances(runName, signal, suite), getStatsByName(runName, signal, suite), getScenarioByName(runName, signal, suite), @@ -92,7 +93,7 @@ export default function Run() { getSchema(signal), ]); - setRunSpec(runSpecs.find((rs) => rs.name === runName)); + setRunSpec(runSpecResp); setInstances(instancesResp); const totalInstancesPages = Math.ceil( instancesResp.length / INSTANCES_PAGE_SIZE, @@ -163,11 +164,7 @@ export default function Run() { ); setModel( - schema.models.find( - (m) => - m.name === - runSpecs.find((rs) => rs.name === runName)?.adapter_spec.model, - ), + schema.models.find((m) => m.name === runSpecResp?.adapter_spec.model), ); } diff --git a/helm-frontend/src/services/getRunSpecByName.ts b/helm-frontend/src/services/getRunSpecByName.ts index a1a9f3f97c..c80a1fb891 100644 --- a/helm-frontend/src/services/getRunSpecByName.ts +++ b/helm-frontend/src/services/getRunSpecByName.ts @@ -10,9 +10,12 @@ export function getRunSpecByNameUrl(runName: string, suite?: string): string { export default async function getRunSpecByName( runName: string, signal: AbortSignal, + suite?: string, ): Promise { try { - const runSpec = await fetch(getRunSpecByNameUrl(runName), { signal }); + const runSpec = await fetch(getRunSpecByNameUrl(runName, suite), { + signal, + }); return (await runSpec.json()) as RunSpec; } catch (error) {