Skip to content

Commit

Permalink
fix: add type to avoid params order errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mariaozamiz committed Jun 4, 2024
1 parent 702735f commit 390ac37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/webapp/pages/analysis/steps/1-outliers/OutliersStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export const OutliersStep: React.FC<PageStepProps> = React.memo(props => {
});

const runAnalysis = () => {
runAnalysisOutlier(
analysis.id,
section.id,
qualityFilters.threshold,
qualityFilters.algorithm
);
runAnalysisOutlier({
algorithm: qualityFilters.algorithm,
analysisId: analysis.id,
sectionId: section.id,
threshold: qualityFilters.threshold,
});
};

if (!analysis) return null;
Expand Down
9 changes: 8 additions & 1 deletion src/webapp/pages/analysis/steps/1-outliers/useOutliers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export function useAnalysisOutlier(props: UseRunAnalysisProps) {
const [error, setError] = React.useState<Maybe<string>>(undefined);

const runAnalysisOutlier = React.useCallback(
(algorithm: string, analysisId: Id, sectionId: Id, threshold: string) => {
(options: RunAnalysisOptionsProps) => {
const { sectionId, algorithm, analysisId, threshold } = options;
setLoading(true);
compositionRoot.outlier.run
.execute({
Expand Down Expand Up @@ -61,3 +62,9 @@ export function useAnalysisOutlier(props: UseRunAnalysisProps) {
}

type UseRunAnalysisProps = { onSucess: (qualityAnalysis: QualityAnalysis) => void };
type RunAnalysisOptionsProps = {
algorithm: string;
analysisId: Id;
sectionId: Id;
threshold: string;
};

0 comments on commit 390ac37

Please sign in to comment.