[Class stats][Courses of class] Change empty fields to be 0, not null

This commit is contained in:
Aaro Koivukangas
2026-04-10 13:39:10 +03:00
committed by Santeri Rajamäki
parent 5e46ce0cb0
commit 40bcbc59dc
@@ -79,7 +79,11 @@ export const PopulationCourseStats = ({
Object.keys(modules).map(parentCode => {
const moduleWithCode = filteredCourses.find(course => course.course.code === parentCode)
const { students, passed, passedOfPopulation } = moduleWithCode?.stats ?? {}
modules[parentCode].module.stats = { students, passed, passedOfPopulation }
modules[parentCode].module.stats = {
students: students ?? 0,
passed: passed ?? 0,
passedOfPopulation: passedOfPopulation ?? 0,
}
})
setModules(