Skip to content

Commit e62dc37

Browse files
committed
feat: Filter out deleted and draft course realisations
1 parent 6e7b5a8 commit e62dc37

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/updater/updateCoursesAndTeacherFeedbackTargets/updateCoursesAndTeacherFeedbackTargets.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,10 @@ const isInactiveRealisationType = (course) => {
443443
})
444444
}
445445

446-
const coursesHandler = async (courses) => {
446+
const coursesHandler = async (initialCourses) => {
447+
// Filter out DELETED and DRAFT courses
448+
const courses = initialCourses.filter(c => !['DELETED', 'DRAFT'].includes(c.documentState))
449+
447450
// Filter out old AY courses. Already existing ones remain in db.
448451
const courseUnits = courses
449452
.flatMap((course) => course.courseUnits)

0 commit comments

Comments
 (0)