Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #340 from SELab-2/fix-frontend-error
Browse files Browse the repository at this point in the history
Fix /student/courses
  • Loading branch information
matt01y authored May 21, 2024
2 parents d3a390d + 39b715c commit ed51c55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/dataloaders/loader_helpers/SharedFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ function getSmallProjectInfo(project: Project): SmallProjectInfo {


function getFirstUpcomingDeadline(courseProjects: Project[]): string | Date {
const first_deadline = courseProjects.filter(course => course.project_visible && !course.project_archived).reduce((minProject, project) => {
const filtered = courseProjects.filter(course => course.project_visible && !course.project_archived);
if (filtered.length === 0) {
return "";
}
const first_deadline = filtered.reduce((minProject, project) => {
if (project.project_deadline < minProject.project_deadline) {
return project;
} else {
Expand Down

0 comments on commit ed51c55

Please sign in to comment.