mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-04 10:49:14 +02:00
fixed frontend (format, lint, build)
This commit is contained in:
@@ -33,6 +33,7 @@ export async function fetchModulesByCourseAndSemester(
|
||||
module.name,
|
||||
module.prof,
|
||||
semester,
|
||||
false,
|
||||
module.events,
|
||||
),
|
||||
),
|
||||
@@ -57,6 +58,7 @@ export async function fetchAllModules(): Promise<Module[]> {
|
||||
module.name,
|
||||
module.prof,
|
||||
module.semester,
|
||||
false,
|
||||
module.events,
|
||||
),
|
||||
);
|
||||
|
@@ -22,6 +22,7 @@ export async function fetchModule(module: Module): Promise<Module> {
|
||||
module.name,
|
||||
module.prof,
|
||||
module.semester,
|
||||
false,
|
||||
module.events,
|
||||
),
|
||||
);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import {Event} from "../model/event.ts";
|
||||
import { Event } from "../model/event.ts";
|
||||
|
||||
export async function fetchRoom(): Promise<string[]> {
|
||||
const rooms: string[] = [];
|
||||
@@ -13,24 +13,26 @@ export async function fetchRoom(): Promise<string[]> {
|
||||
}
|
||||
|
||||
export async function fetchEventsByRoomAndDuration(
|
||||
room: string,
|
||||
from_date: string,
|
||||
to_date: string,
|
||||
room: string,
|
||||
from_date: string,
|
||||
to_date: string,
|
||||
): Promise<Event[]> {
|
||||
const events: Event[] = [];
|
||||
await fetch("/api/schedule?room=" + room + "&from=" + from_date + "&to=" + to_date)
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
return response.json();
|
||||
})
|
||||
.then((eventsResponse) => {
|
||||
console.log("Response:", eventsResponse);
|
||||
eventsResponse.forEach((event: Event) =>
|
||||
events.push(event));
|
||||
}).catch((error) => {
|
||||
console.log("Error fetching events: ", error);
|
||||
return null;
|
||||
})
|
||||
console.log("occupations: ", events);
|
||||
return events;
|
||||
}
|
||||
const events: Event[] = [];
|
||||
await fetch(
|
||||
"/api/schedule?room=" + room + "&from=" + from_date + "&to=" + to_date,
|
||||
)
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
return response.json();
|
||||
})
|
||||
.then((eventsResponse) => {
|
||||
console.log("Response:", eventsResponse);
|
||||
eventsResponse.forEach((event: Event) => events.push(event));
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("Error fetching events: ", error);
|
||||
return null;
|
||||
});
|
||||
console.log("occupations: ", events);
|
||||
return events;
|
||||
}
|
||||
|
Reference in New Issue
Block a user