From 00230d6a663a07d56c3042d42f2b255953759bce Mon Sep 17 00:00:00 2001 From: Leon <43097991+unkn-wn@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:13:21 -0500 Subject: [PATCH 1/2] fix for weird classes --- src/components/calendar.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/calendar.js b/src/components/calendar.js index 09a7368..0810d8c 100644 --- a/src/components/calendar.js +++ b/src/components/calendar.js @@ -145,6 +145,15 @@ const MeetingDisplay = ({ meeting, isHighlighted, onHover }) => ( export const getCourseData = async (subjectCode, courseCode, title) => { try { + // BANDAID FIX #1: Hardcode STAT 416 and STAT 519 + console.log(subjectCode, courseCode); + if (subjectCode === 'STAT') { + if (courseCode === 41600 || courseCode === 51900) { + subjectCode = 'MA'; + } + } + + // HARD CODED SEMESTER const semester = "202520"; const url = "https://api.purdue.io/odata/Courses?$expand=Classes($filter=Term/Code eq '" + semester + "';$expand=Sections($expand=Meetings($expand=Instructors,Room($expand=Building))))" + @@ -156,6 +165,7 @@ export const getCourseData = async (subjectCode, courseCode, title) => { const response = await fetch(url); const data = await response.json(); + // BANDAID FIX #2: Filter out courses with the same title if (data.value.length > 1) { console.warn('Multiple courses found with the same title:', data.value); data.value = data.value.filter(course => course.Title === title); From c96fad95fe8349c6eeb4085eb878b9803792c260 Mon Sep 17 00:00:00 2001 From: Leon <43097991+unkn-wn@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:18:43 -0500 Subject: [PATCH 2/2] Update calendar.js --- src/components/calendar.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/calendar.js b/src/components/calendar.js index 0810d8c..301916a 100644 --- a/src/components/calendar.js +++ b/src/components/calendar.js @@ -146,7 +146,6 @@ const MeetingDisplay = ({ meeting, isHighlighted, onHover }) => ( export const getCourseData = async (subjectCode, courseCode, title) => { try { // BANDAID FIX #1: Hardcode STAT 416 and STAT 519 - console.log(subjectCode, courseCode); if (subjectCode === 'STAT') { if (courseCode === 41600 || courseCode === 51900) { subjectCode = 'MA';