fix:#5 added room table and changed sql query

This commit is contained in:
Elmar Kresse
2024-01-25 00:34:42 +01:00
parent 1b536dd008
commit fe8e22da5a
4 changed files with 119 additions and 19 deletions

View 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;
}