Skip to content

Commit

Permalink
get sensitivity factors count according to the node id (#2164)
Browse files Browse the repository at this point in the history
---------

Signed-off-by: Etienne LESOT <[email protected]>
  • Loading branch information
EtienneLt authored Jul 18, 2024
1 parent e734e69 commit 762ded2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export const SensitivityAnalysisParameters = ({

const { reset, handleSubmit, formState, getValues, setValue } = formMethods;
const studyUuid = useSelector((state) => state.studyUuid);
const currentNode = useSelector((state) => state.currentTreeNode);
const [sensitivityAnalysisParams, setSensitivityAnalysisParams] =
useState(params);

Expand Down Expand Up @@ -225,6 +226,7 @@ export const SensitivityAnalysisParameters = ({
setLaunchLoader(true);
getSensitivityAnalysisFactorsCount(
studyUuid,
currentNode.id,
arrayFormName === SENSI_INJECTIONS_SET,
formatFilteredParams(row)
)
Expand All @@ -246,7 +248,14 @@ export const SensitivityAnalysisParameters = ({
});
});
},
[snackError, studyUuid, formatFilteredParams, setValue, getResultCount]
[
snackError,
studyUuid,
formatFilteredParams,
setValue,
getResultCount,
currentNode,
]
);

const fromSensitivityAnalysisParamsDataToFormValues = useCallback(
Expand Down
6 changes: 3 additions & 3 deletions src/services/study/sensitivity-analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export function setSensitivityAnalysisParameters(studyUuid, newParams) {

export function getSensitivityAnalysisFactorsCount(
studyUuid,
currentNodeUuid,
isInjectionsSet,
newParams
) {
Expand All @@ -145,9 +146,8 @@ export function getSensitivityAnalysisFactorsCount(
urlSearchParams.append(`ids[${key}]`, newParams[key])
);

const url =
getStudyUrl(studyUuid) +
`/sensitivity-analysis/factors-count?${urlSearchParams}`;
const url = `${getStudyUrlWithNodeUuid(studyUuid, currentNodeUuid)}
/sensitivity-analysis/factors-count?${urlSearchParams}`;
console.debug(url);
return backendFetch(url, {
method: 'GET',
Expand Down

0 comments on commit 762ded2

Please sign in to comment.