From c24766f8965d3cbafa2f90975a0caedb316fcb44 Mon Sep 17 00:00:00 2001 From: Riku Rauhala Date: Thu, 22 Aug 2024 11:56:43 +0300 Subject: [PATCH] [Backend] Improve types --- .../services/courses/courseYearlyStatsCounter.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/services/backend/src/services/courses/courseYearlyStatsCounter.ts b/services/backend/src/services/courses/courseYearlyStatsCounter.ts index 208848267c..cb72490e9f 100644 --- a/services/backend/src/services/courses/courseYearlyStatsCounter.ts +++ b/services/backend/src/services/courses/courseYearlyStatsCounter.ts @@ -351,7 +351,7 @@ export class CourseYearlyStatsCounter { if (anonymizationSalt && normalStats.students.studentnumbers.length < 6) { this.obfuscated = true - const gradeSpread = {} + const gradeSpread = {} as { [grade: string]: string[] } for (const grade of Object.keys(normalStats.attempts.grades)) { gradeSpread[grade] = [] } @@ -363,19 +363,19 @@ export class CourseYearlyStatsCounter { coursecode: rest.coursecode, attempts: { categories: { - failed: [], - passed: [], + failed: [] as string[], + passed: [] as string[], }, grades: gradeSpread, }, yearcode: rest.yearcode, students: { categories: { - passedFirst: [], - passedEventually: [], - neverPassed: [], + passedFirst: [] as string[], + passedEventually: [] as string[], + neverPassed: [] as string[], }, - studentnumbers: [], + studentnumbers: [] as string[], }, } return obfuscatedStats