mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2026-01-17 12:02:26 +01:00
fix:#5 added room table and changed sql query
This commit is contained in:
16
frontend/src/api/requestFreeRooms.ts
Normal file
16
frontend/src/api/requestFreeRooms.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
// load free rooms as a list of strings form the backend
|
||||
|
||||
export async function requestFreeRooms(from: string, to: string): Promise<string[]> {
|
||||
console.debug("requestFreeRooms: from=" + from + ", to=" + to)
|
||||
const rooms: string[] = [];
|
||||
await fetch("/api/rooms/free?from=" + from + "&to=" + to)
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
})
|
||||
.then((roomsResponse: [] | null) => {
|
||||
roomsResponse?.forEach((room: string) => rooms.push(room));
|
||||
});
|
||||
return rooms;
|
||||
}
|
||||
Reference in New Issue
Block a user