Skip to content

Commit

Permalink
[Open uni] Fix code that checks if student has degreestudyright
Browse files Browse the repository at this point in the history
  • Loading branch information
ShootingStar91 committed Mar 7, 2024
1 parent 96a185a commit 1a8ccde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions services/backend/src/services/openUni/openUniSearches.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ const getStudyRights = async students =>
student_studentnumber: {
[Op.in]: students.length > 0 ? students : { [Op.not]: null },
},
extentcode: {
[Op.in]: [1, 2, 3, 4],
},
},
})
).map(mapStudyRights)
Expand Down
4 changes: 2 additions & 2 deletions services/backend/src/services/openUni/openUniStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { getCredits, getStudyRights, getEnrollments, getStudentInfo, getCourseNam

const uniq = objects => [...new Set(objects)]

const calulateTotalsForStudent = async (studentStats, studentnumber) => {
const calculateTotalsForStudent = async (studentStats, studentnumber) => {
Object.keys(studentStats[studentnumber].courseInfo).forEach(course => {
if (studentStats[studentnumber].courseInfo[course].status.passed) {
studentStats[studentnumber].totals.passed += 1
Expand Down Expand Up @@ -100,7 +100,7 @@ const getCustomOpenUniCourses = async (courseCodes, startdate, enddate) => {
}
}
}
await calulateTotalsForStudent(studentStats, studentnumber)
await calculateTotalsForStudent(studentStats, studentnumber)
}
}
const openUniStats = { students: studentStats, courses: courses }
Expand Down

0 comments on commit 1a8ccde

Please sign in to comment.