From 4cf206773643be5832989ccd818ab6bb4de31ce1 Mon Sep 17 00:00:00 2001 From: Elmar Kresse Date: Sun, 4 Feb 2024 00:55:49 +0100 Subject: [PATCH] feat:#26 switch to course route only for courses that have events --- frontend/src/api/fetchCourse.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }