File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
frontend/app/components/modules/project/views Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -220,10 +220,15 @@ const groupedData = computed(() => (securityAssessmentData.value || []).reduce((
220220 if (! obj [check .category ]) {
221221 obj [check .category ] = [];
222222 }
223- check . assessments = PROJECT_SECURITY_SERVICE .orderAssessmentsByRequirementId (
223+ const tmpAssessments = PROJECT_SECURITY_SERVICE .orderAssessmentsByRequirementId (
224224 PROJECT_SECURITY_SERVICE .mergeDuplicateAssessments (check .assessments )
225225 );
226- obj [check .category ]?.push (check );
226+ // Create a copy of the check object to avoid mutating the original
227+ const checkCopy = {
228+ ... check ,
229+ assessments: tmpAssessments
230+ };
231+ obj [check .category ]?.push (checkCopy );
227232 return obj ;
228233 }, {} as Record <string , SecurityData []>))
229234
@@ -232,10 +237,15 @@ const groupChecksByRepository = (checks: SecurityData[]) => (checks || []).reduc
232237 if (! obj [check .repo ]) {
233238 obj [check .repo ] = [];
234239 }
235- check . assessments = PROJECT_SECURITY_SERVICE .orderAssessmentsByRequirementId (
240+ const tmpAssessments = PROJECT_SECURITY_SERVICE .orderAssessmentsByRequirementId (
236241 PROJECT_SECURITY_SERVICE .mergeDuplicateAssessments (check .assessments )
237242 );
238- obj [check .repo ]?.push (check );
243+ // Create a copy of the check object to avoid mutating the original
244+ const checkCopy = {
245+ ... check ,
246+ assessments: tmpAssessments
247+ };
248+ obj [check .repo ]?.push (checkCopy );
239249 return obj ;
240250 }, {} as Record <string , SecurityData []>)
241251
You can’t perform that action at this time.
0 commit comments