File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
app/src/components/domain/PerAssessmentSummary Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -161,9 +161,10 @@ function PerAssessmentSummary(props: Props) {
161161 ( areaResponse ) => {
162162 // NOTE: do we take the average of only rated components or of all the
163163 // components?
164+ // Also, 'component.rating' refers to the component ID and is misnamed.
164165 const filteredComponents = areaResponse ?. component_responses ?. filter (
165- ( component ) => isDefined ( component ?. rating_details ?. value )
166- && component . rating_details . value !== 0 ,
166+ ( component ) => isDefined ( component ?. rating )
167+ && component . rating !== 1 ,
167168 ) ?? [ ] ;
168169
169170 if ( filteredComponents . length === 0 ) {
@@ -172,8 +173,8 @@ function PerAssessmentSummary(props: Props) {
172173
173174 const ratings = filteredComponents . map (
174175 ( component ) => (
175- isDefined ( component . rating_details ?. value )
176- ? component . rating_details . value
176+ isDefined ( component . rating )
177+ ? ratingIdToValueMap ?. [ component . rating ]
177178 : 0
178179 ) ,
179180 ) ;
You can’t perform that action at this time.
0 commit comments