mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 09:38:51 +02:00
feat:#26 switch to course route only for courses that have events
This commit is contained in:
@ -24,7 +24,7 @@ export async function fetchCourseBySemester(
|
||||
semester: string,
|
||||
): Promise<string[]> {
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user