From 42e8f086d37862f69ebdd474933cfd7a810f6de9 Mon Sep 17 00:00:00 2001 From: AbhiramTadepalli Date: Mon, 3 Feb 2025 18:00:22 -0600 Subject: [PATCH] Properly display the most recent semester for Course Overalls --- .../search/SearchResultsTable/searchResultsTable.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/search/SearchResultsTable/searchResultsTable.tsx b/src/components/search/SearchResultsTable/searchResultsTable.tsx index 95e3b36f..d321f222 100644 --- a/src/components/search/SearchResultsTable/searchResultsTable.tsx +++ b/src/components/search/SearchResultsTable/searchResultsTable.tsx @@ -116,6 +116,17 @@ function Row({ most_recent_semester_from_grades: string, ): string { let { season, yyyy } = getCurrentSemester(); + console.log('hi', sections); + if ( + typeof sections !== 'undefined' && + sections.state === 'done' && + typeof course.profFirst === 'undefined' && + typeof course.profLast === 'undefined' + ) { + return sections.data.sort((a, b) => + compareSemesters(b.academic_session.name, a.academic_session.name), + )[0].academic_session.name; + } if ( typeof sections !== 'undefined' && typeof professor !== 'undefined' &&