From 5ff4da38e0526e356a0deb1c0c1c1ba925fb5134 Mon Sep 17 00:00:00 2001 From: Selwyn Date: Wed, 31 Jul 2024 10:29:50 +0200 Subject: [PATCH] WIP --- src/server/api/consume-opening-hours.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/api/consume-opening-hours.ts b/src/server/api/consume-opening-hours.ts index 5acf894e..5505282f 100644 --- a/src/server/api/consume-opening-hours.ts +++ b/src/server/api/consume-opening-hours.ts @@ -87,6 +87,7 @@ export default defineEventHandler(async (event) => { number: building.number, openEvents: calendarView.value .filter((event: CalendarEvent) => event.subject === 'Open') + .map((event) => { console.log(building.number, event.start.dateTime); return event }) .map((event: CalendarEvent) => ({ start: new Date(event.start.dateTime).toISOString(), end: new Date(event.end.dateTime).toISOString(), @@ -106,6 +107,7 @@ export default defineEventHandler(async (event) => { ), ); + console.log(JSON.stringify({buildingsOpeningDates}, null, 2)) const { error } = await client.from('buildings').upsert( // @ts-expect-error buildingsOpeningDates.map((building) => ({ @@ -120,6 +122,7 @@ export default defineEventHandler(async (event) => { return event.node.res.end(); } + console.info(`Consumed opening hours of ${buildingsOpeningDates.length} buildings`); event.node.res.statusCode = 202; event.node.res.end(); });