From b9d1dd1059829970e960565c2c1639fb7c4ca9de Mon Sep 17 00:00:00 2001 From: nicolas Date: Wed, 9 Jun 2021 21:47:03 +0200 Subject: [PATCH] Potentially working update method for google calendar --- lib/calendarClient.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/calendarClient.ts b/lib/calendarClient.ts index b19c5166..7a6b347d 100644 --- a/lib/calendarClient.ts +++ b/lib/calendarClient.ts @@ -245,7 +245,20 @@ const GoogleCalendar = (credential): CalendarApiAdapter => { }); }), updateEvent: (uid: String, event: CalendarEvent) => new Promise((resolve, reject) => { - //TODO implement + const calendar = google.calendar({version: 'v3', auth: myGoogleAuth}); + calendar.events.updateEvent({ + auth: myGoogleAuth, + calendarId: 'primary', + eventId: uid, + sendNotifications: true, + sendUpdates: 'all', + }, function (err, event) { + if (err) { + console.log('There was an error contacting the Calendar service: ' + err); + return reject(err); + } + return resolve(event.data); + }); }), deleteEvent: (uid: String) => new Promise( (resolve, reject) => { const calendar = google.calendar({version: 'v3', auth: myGoogleAuth});