From 14c421cf61324fafe7f9574533bec6b7d1c2ac36 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Mon, 24 Jun 2024 02:17:10 +0200 Subject: [PATCH] tmp --- webclient/components/CalendarModal.vue | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/webclient/components/CalendarModal.vue b/webclient/components/CalendarModal.vue index f6da175f1..ee190f997 100644 --- a/webclient/components/CalendarModal.vue +++ b/webclient/components/CalendarModal.vue @@ -4,11 +4,12 @@ import { CalendarView, CalendarViewHeader } from "vue-simple-calendar"; // @ts-expect-error import type { ICalendarItem } from "vue-simple-calendar/dist/src/ICalendarItem.d.ts"; -import type { components } from "@/api_types"; +import type { components, operations } from "@/api_types"; import "/node_modules/vue-simple-calendar/dist/style.css"; import "/node_modules/vue-simple-calendar/dist/css/gcal.css"; type CalendarResponse = components["schemas"]["CalendarResponse"]; +type CalendarBody = operations["calendar"]["requestBody"]["content"]["application/json"]; const showDate = ref(new Date()); @@ -27,14 +28,20 @@ const end_before = computed(() => { }); const runtimeConfig = useRuntimeConfig(); -const url = computed(() => { - const params = new URLSearchParams(); - params.append("start_after", start_after.value); - params.append("end_before", end_before.value); - - return `${runtimeConfig.public.apiURL}/api/calendar/${calendar.value.showing[0]}?${params.toString()}`; +const url = computed(() => `${runtimeConfig.public.apiURL}/api/calendar`); +const body = computed(() => ({ + start_after: start_after.value, + end_before: end_before.value, + ids: calendar.value.showing, +})); +const { data, status, error } = useFetch(url, { + key: "calendar", + dedupe: "defer", + deep: false, + body: body, + retry: 120, + retryDelay: 5000, }); -const { data, status, error } = useFetch(url, { key: "calendar", dedupe: "defer", deep: false }); const earliest_last_sync = computed(() => { if (!data.value) return null; return Object.values(data.value)