mirror of
https://github.com/UniversityOfHelsinkiCS/oodikone.git
synced 2026-10-12 19:03:39 +03:00
[Filters][Hops] Fix study right logic when student has a cancelled study right
This commit is contained in:
@@ -111,7 +111,9 @@ export const hopsFilter = createFilter<Options, Args, Precompute>({
|
||||
mutate: (student, { args, options }) => {
|
||||
const { activeProgramme, activeCombinedProgramme } = options
|
||||
|
||||
const studyRights = student.studyRights.filter(({ cancelled }) => !cancelled).map(({ id }) => id)
|
||||
const studyRights = student.studyRights
|
||||
.filter(({ cancelled, studyRightElements }) => !cancelled || studyRightElements.some(sre => sre.graduated))
|
||||
.map(({ id }) => id)
|
||||
const hops = student.studyplans.find(
|
||||
({ programme_code, sis_study_right_id }) =>
|
||||
programme_code === args.programmeCode && studyRights.includes(sis_study_right_id)
|
||||
|
||||
Reference in New Issue
Block a user