mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2026-01-17 03:52:26 +01:00
feat:#5 added datetime input for search and fixed nav bar
This commit is contained in:
@@ -6,8 +6,8 @@ export async function fetchRoom(): Promise<string[]> {
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
})
|
||||
.then((roomsResponse) => {
|
||||
roomsResponse.forEach((room: string) => rooms.push(room));
|
||||
.then((roomsResponse: [] | null) => {
|
||||
roomsResponse?.forEach((room: string) => rooms.push(room));
|
||||
});
|
||||
return rooms;
|
||||
}
|
||||
@@ -22,17 +22,15 @@ export async function fetchEventsByRoomAndDuration(
|
||||
"/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: AnonymizedEventDTO) => events.push(event));
|
||||
.then((eventsResponse: [] | null) => {
|
||||
eventsResponse?.forEach((event: AnonymizedEventDTO) =>
|
||||
events.push(event),
|
||||
);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("Error fetching events: ", error);
|
||||
return Promise.reject(error);
|
||||
});
|
||||
console.log("occupations: ", events);
|
||||
return events;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user