Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jun 24, 2024
1 parent 8dc0535 commit 14c421c
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions webclient/components/CalendarModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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<CalendarBody>(() => ({
start_after: start_after.value,
end_before: end_before.value,
ids: calendar.value.showing,
}));
const { data, status, error } = useFetch<CalendarResponse>(url, {
key: "calendar",
dedupe: "defer",
deep: false,
body: body,
retry: 120,
retryDelay: 5000,
});
const { data, status, error } = useFetch<CalendarResponse>(url, { key: "calendar", dedupe: "defer", deep: false });
const earliest_last_sync = computed<string | null>(() => {
if (!data.value) return null;
return Object.values(data.value)
Expand Down

0 comments on commit 14c421c

Please sign in to comment.