Skip to content

Commit

Permalink
[Students] Filter out option studyrights
Browse files Browse the repository at this point in the history
  • Loading branch information
outisa committed Jun 13, 2023
1 parent 4f8284d commit 97d9d06
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions services/backend/src/services/students.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ const byId = async id => {
},
},
},
where: {
prioritycode: {
[Op.not]: 6,
},
},
},
{
model: SemesterEnrollment,
Expand Down Expand Up @@ -103,9 +98,11 @@ const byId = async id => {
startYear: semester.startYear,
}
})

student.semester_enrollments = mappedEnrollments

const filteredStudyrights = student.studyrights.filter(sr => sr.prioritycode !== 6)
student.studyrights = filteredStudyrights

student.tags = tags.map(t => ({
...t.get(),
programme: tagprogrammes.find(p => p.code === t.tag.studytrack),
Expand Down Expand Up @@ -250,6 +247,8 @@ const formatStudent = async ({
}

studyrights = studyrights || []
// const secondaryStudyRights = studyrights.filter(sr => sr.prioritycode === 2))

semester_enrollments = semester_enrollments || []
studyplans = studyplans || []
const semesterenrollments = semester_enrollments.map(
Expand Down

0 comments on commit 97d9d06

Please sign in to comment.