Skip to content

Commit 090b17b

Browse files
committed
fix
1 parent 7e20da1 commit 090b17b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/react-doctor/src/utils/calculate-score.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ const WARNING_RULE_PENALTY = 0.75;
1212
const ERROR_ESTIMATED_FIX_RATE = 0.85;
1313
const WARNING_ESTIMATED_FIX_RATE = 0.8;
1414

15-
const buildDiagnosticPayload = (diagnostics: Diagnostic[]): Diagnostic[] => diagnostics;
16-
1715
const getScoreLabel = (score: number): string => {
1816
if (score >= SCORE_GOOD_THRESHOLD) return "Great";
1917
if (score >= SCORE_OK_THRESHOLD) return "Needs work";
@@ -71,7 +69,7 @@ export const calculateScore = async (diagnostics: Diagnostic[]): Promise<ScoreRe
7169
const response = await fetch(SCORE_API_URL, {
7270
method: "POST",
7371
headers: { "Content-Type": "application/json" },
74-
body: JSON.stringify({ diagnostics: buildDiagnosticPayload(diagnostics) }),
72+
body: JSON.stringify({ diagnostics }),
7573
});
7674

7775
if (!response.ok) return null;
@@ -89,7 +87,7 @@ export const fetchEstimatedScore = async (
8987
const response = await fetch(ESTIMATE_SCORE_API_URL, {
9088
method: "POST",
9189
headers: { "Content-Type": "application/json" },
92-
body: JSON.stringify({ diagnostics: buildDiagnosticPayload(diagnostics) }),
90+
body: JSON.stringify({ diagnostics }),
9391
});
9492

9593
if (!response.ok) return estimateScoreLocally(diagnostics);

0 commit comments

Comments
 (0)