Skip to content

Commit

Permalink
fix: filter disabled course tasks (#2328)
Browse files Browse the repository at this point in the history
  • Loading branch information
valerydluski authored Oct 24, 2023
1 parent dbb1d24 commit 276069d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nestjs/src/tasks/dto/task.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export class TaskDto {
this.discipline = task.discipline ? new IdNameDto(task.discipline) : null;
this.courses = task.courseTasks
? uniqBy(
task.courseTasks.map(({ course }) => new UsedCourseDto({ name: course.name, isActive: !course.completed })),
task.courseTasks
.filter(task => !task.disabled)
.map(({ course }) => new UsedCourseDto({ name: course.name, isActive: !course.completed })),
course => course.name,
).sort((a, b) => {
if (a.isActive === b.isActive) {
Expand Down

0 comments on commit 276069d

Please sign in to comment.