All day event package

This commit is contained in:
Milan Paunovic
2024-11-01 22:02:36 +01:00
parent 61fff87975
commit 87137e7b15
12 changed files with 322 additions and 146 deletions

View File

@ -9,11 +9,12 @@ export const useFetchAndSaveAppleEvents = () => {
const {mutateAsync: createEventsFromProvider} = useCreateEventsFromProvider();
return useMutation({
mutationKey: ["fetchAndSaveAppleEvents"],
mutationFn: async ({token, email}: { token?: string, email?: string }) => {
console.log("CALLL")
const timeMin = new Date(new Date().setFullYear(new Date().getFullYear() - 1));
const timeMax = new Date(new Date().setFullYear(new Date().getFullYear() + 5));
mutationKey: ["fetchAndSaveAppleEvents", "sync"],
mutationFn: async ({token, email, date}: { token?: string; email?: string, date?: Date }) => {
const baseDate = date || new Date();
const timeMin = new Date(new Date(baseDate).setFullYear(new Date(baseDate).getMonth() - 1));
const timeMax = new Date(new Date(baseDate).setFullYear(new Date(baseDate).getMonth() + 1));
try {
const response = await fetchiPhoneCalendarEvents(
profileData?.familyId!,