Merge branch 'main' of github.com:masterElmar/htwkalender into 10-roomfinder

This commit is contained in:
Tom Wahl
2023-10-28 13:44:14 +02:00
24 changed files with 585 additions and 309 deletions

View File

@@ -27,6 +27,7 @@ export async function fetchModulesByCourseAndSemester(
modulesResponse.forEach((module: Module) =>
modules.push(
new Module(
module.uuid,
module.name,
course,
module.name,
@@ -50,6 +51,7 @@ export async function fetchAllModules(): Promise<Module[]> {
responseModules.forEach((module: Module) => {
modules.push(
new Module(
module.uuid,
module.name,
module.course,
module.name,

View File

@@ -1,12 +1,12 @@
import { Module } from "../model/module";
export async function fetchModule(name: string): Promise<Module> {
export async function fetchModule(module: Module): Promise<Module> {
const request = new Request("/api/module", {
method: "GET",
method: "POST",
headers: {
"Content-Type": "application/json",
Name: encodeURI(name),
},
body: JSON.stringify(module),
});
return await fetch(request)
@@ -16,6 +16,7 @@ export async function fetchModule(name: string): Promise<Module> {
.then(
(module: Module) =>
new Module(
module.uuid,
module.name,
module.course,
module.name,