@@ -12,8 +12,6 @@ const WARNING_RULE_PENALTY = 0.75;
1212const ERROR_ESTIMATED_FIX_RATE = 0.85 ;
1313const WARNING_ESTIMATED_FIX_RATE = 0.8 ;
1414
15- const buildDiagnosticPayload = ( diagnostics : Diagnostic [ ] ) : Diagnostic [ ] => diagnostics ;
16-
1715const 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