From 550e0ea488820d76ad37d671c585ee3c85089f9c Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung Date: Wed, 20 Apr 2022 10:59:24 -0400 Subject: [PATCH] Convert uid to google event uid format --- packages/app-store/googlecalendar/lib/CalendarService.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/app-store/googlecalendar/lib/CalendarService.ts b/packages/app-store/googlecalendar/lib/CalendarService.ts index 1e742aa35c..49ae3d6552 100644 --- a/packages/app-store/googlecalendar/lib/CalendarService.ts +++ b/packages/app-store/googlecalendar/lib/CalendarService.ts @@ -76,6 +76,7 @@ export default class GoogleCalendarService implements Calendar { return new Promise((resolve, reject) => this.auth.getToken().then((myGoogleAuth) => { const payload: calendar_v3.Schema$Event = { + id: event.uid!.toLowerCase().replace(/[wxyz]/g, ""), summary: event.title, description: getRichDescription(event), start: { @@ -117,6 +118,10 @@ export default class GoogleCalendarService implements Calendar { conferenceDataVersion: 1, }, function (err, event) { + console.log( + "🚀 ~ file: CalendarService.ts ~ line 120 ~ GoogleCalendarService ~ this.auth.getToken ~ event", + event + ); if (err || !event?.data) { console.error("There was an error contacting google calendar service: ", err); return reject(err); @@ -172,7 +177,7 @@ export default class GoogleCalendarService implements Calendar { calendarId: event.destinationCalendar?.externalId ? event.destinationCalendar.externalId : "primary", - eventId: uid, + eventId: uid.toLowerCase().replace(/[wxyz]/g, ""), sendNotifications: true, sendUpdates: "all", requestBody: payload, @@ -203,7 +208,7 @@ export default class GoogleCalendarService implements Calendar { calendarId: event.destinationCalendar?.externalId ? event.destinationCalendar.externalId : "primary", - eventId: uid, + eventId: uid.toLowerCase().replace(/[wxyz]/g, ""), sendNotifications: true, sendUpdates: "all", },