mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 17:48: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,
|
semester: string,
|
||||||
): Promise<string[]> {
|
): Promise<string[]> {
|
||||||
const courses: string[] = [];
|
const courses: string[] = [];
|
||||||
await fetch("/api/courses?semester=" + semester)
|
await fetch("/api/courses/events?semester=" + semester)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
//check if response type is json
|
//check if response type is json
|
||||||
const contentType = response.headers.get("content-type");
|
const contentType = response.headers.get("content-type");
|
||||||
@ -35,7 +35,7 @@ export async function fetchCourseBySemester(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then((coursesResponse) => {
|
.then((coursesResponse) => {
|
||||||
coursesResponse.forEach((course: string) => courses.push(course));
|
coursesResponse?.forEach((course: string) => courses.push(course));
|
||||||
});
|
});
|
||||||
return courses;
|
return courses;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user