From 403823fc62fc5d9d5860f6f243101bd1e9153217 Mon Sep 17 00:00:00 2001 From: nicolas Date: Wed, 9 Jun 2021 21:22:34 +0200 Subject: [PATCH] change event for outlook implemented --- lib/calendarClient.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/calendarClient.ts b/lib/calendarClient.ts index bf8ddf58..b19c5166 100644 --- a/lib/calendarClient.ts +++ b/lib/calendarClient.ts @@ -164,9 +164,14 @@ const MicrosoftOffice365Calendar = (credential): CalendarApiAdapter => { 'Authorization': 'Bearer ' + accessToken } }).then(handleErrorsRaw)), - updateEvent: (uid: String, event: CalendarEvent) => { - //TODO Implement - }, + updateEvent: (uid: String, event: CalendarEvent) => auth.getToken().then(accessToken => fetch('https://graph.microsoft.com/v1.0/me/calendar/events/' + uid, { + method: 'PATCH', + headers: { + 'Authorization': 'Bearer ' + accessToken, + 'Content-Type': 'application/json' + }, + body: JSON.stringify(translateEvent(event)) + }).then(handleErrorsRaw)), } };