98 implement anonymized DTO events

This commit is contained in:
survellow
2023-12-12 23:40:43 +01:00
parent e8f29941a1
commit 9956261eab
7 changed files with 263 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
import { Event } from "../model/event.ts";
import { AnonymizedEventDTO } from "../model/event.ts";
export async function fetchRoom(): Promise<string[]> {
const rooms: string[] = [];
@@ -16,8 +16,8 @@ export async function fetchEventsByRoomAndDuration(
room: string,
from_date: string,
to_date: string,
): Promise<Event[]> {
const events: Event[] = [];
): Promise<AnonymizedEventDTO[]> {
const events: AnonymizedEventDTO[] = [];
await fetch(
"/api/schedule?room=" + room + "&from=" + from_date + "&to=" + to_date,
)
@@ -27,7 +27,7 @@ export async function fetchEventsByRoomAndDuration(
})
.then((eventsResponse) => {
console.log("Response:", eventsResponse);
eventsResponse.forEach((event: Event) => events.push(event));
eventsResponse.forEach((event: AnonymizedEventDTO) => events.push(event));
})
.catch((error) => {
console.log("Error fetching events: ", error);