diff --git a/frontend/src/api/fetchCourse.ts b/frontend/src/api/fetchCourse.ts index e953c7c..b29fc43 100644 --- a/frontend/src/api/fetchCourse.ts +++ b/frontend/src/api/fetchCourse.ts @@ -24,7 +24,7 @@ export async function fetchCourseBySemester( semester: string, ): Promise { const courses: string[] = []; - await fetch("/api/courses?semester=" + semester) + await fetch("/api/courses/events?semester=" + semester) .then((response) => { //check if response type is json const contentType = response.headers.get("content-type"); @@ -35,7 +35,7 @@ export async function fetchCourseBySemester( } }) .then((coursesResponse) => { - coursesResponse.forEach((course: string) => courses.push(course)); + coursesResponse?.forEach((course: string) => courses.push(course)); }); return courses; }