mirror of
https://github.com/UniversityOfHelsinkiCS/oodikone.git
synced 2026-10-12 19:03:39 +03:00
[Class stats][Courses of class] Change empty fields to be 0, not null
This commit is contained in:
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(
|
||||
|
||||
Reference in New Issue
Block a user