mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
single path depending on option for scenarioId
This commit is contained in:
parent
c5588e67e2
commit
72b91ad99d
1 changed files with 2 additions and 8 deletions
|
|
@ -46,10 +46,7 @@ async function fetchScenarioReport({
|
||||||
hideNonCompliant: String(hideNonCompliant),
|
hideNonCompliant: String(hideNonCompliant),
|
||||||
});
|
});
|
||||||
|
|
||||||
const path =
|
const path = `/api/portfolio/${portfolioId}/scenario/${scenarioId}/metrics`;
|
||||||
scenarioId === "default"
|
|
||||||
? `/api/portfolio/${portfolioId}/scenario/default/metrics`
|
|
||||||
: `/api/portfolio/${portfolioId}/scenario/${scenarioId}/metrics`;
|
|
||||||
|
|
||||||
const res = await fetch(`${path}?${params.toString()}`);
|
const res = await fetch(`${path}?${params.toString()}`);
|
||||||
|
|
||||||
|
|
@ -67,10 +64,7 @@ async function fetchScenarioMeasures({
|
||||||
portfolioId: number;
|
portfolioId: number;
|
||||||
scenarioId: number | "default";
|
scenarioId: number | "default";
|
||||||
}) {
|
}) {
|
||||||
const path =
|
const path = `/api/portfolio/${portfolioId}/scenario/${scenarioId}/measures`;
|
||||||
scenarioId === "default"
|
|
||||||
? `/api/portfolio/${portfolioId}/scenario/default/measures`
|
|
||||||
: `/api/portfolio/${portfolioId}/scenario/${scenarioId}/measures`;
|
|
||||||
|
|
||||||
const res = await fetch(path);
|
const res = await fetch(path);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue