mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-25 22:09:15 +02:00
add static site generation including robots.txt and sitemap.xml
This commit is contained in:
@@ -19,6 +19,9 @@
|
||||
import { Module } from "../model/module.ts";
|
||||
|
||||
export async function fetchCourse(): Promise<string[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const courses: string[] = [];
|
||||
await fetch("/api/courses")
|
||||
.then((response) => {
|
||||
@@ -39,6 +42,9 @@ export async function fetchCourse(): Promise<string[]> {
|
||||
export async function fetchCourseBySemester(
|
||||
semester: string,
|
||||
): Promise<string[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const courses: string[] = [];
|
||||
await fetch("/api/courses/events?semester=" + semester)
|
||||
.then((response) => {
|
||||
@@ -60,6 +66,9 @@ export async function fetchModulesByCourseAndSemester(
|
||||
course: string,
|
||||
semester: string,
|
||||
): Promise<Module[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const modules: Module[] = [];
|
||||
await fetch("/api/course/modules?course=" + course + "&semester=" + semester)
|
||||
.then((response) => {
|
||||
@@ -86,6 +95,9 @@ export async function fetchModulesByCourseAndSemester(
|
||||
}
|
||||
|
||||
export async function fetchAllModules(): Promise<Module[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const modules: Module[] = [];
|
||||
await fetch("/api/modules")
|
||||
.then((response) => {
|
||||
|
Reference in New Issue
Block a user