Fixed update method

pull/253/head
nicolas 2021-06-09 22:03:05 +02:00
parent bd1cb474c5
commit 3e338aaa05
1 changed files with 24 additions and 0 deletions

View File

@ -245,6 +245,30 @@ const GoogleCalendar = (credential): CalendarApiAdapter => {
});
}),
updateEvent: (uid: String, event: CalendarEvent) => new Promise((resolve, reject) => {
const payload = {
summary: event.title,
description: event.description,
start: {
dateTime: event.startTime,
timeZone: event.organizer.timeZone,
},
end: {
dateTime: event.endTime,
timeZone: event.organizer.timeZone,
},
attendees: event.attendees,
reminders: {
useDefault: false,
overrides: [
{'method': 'email', 'minutes': 60}
],
},
};
if (event.location) {
payload['location'] = event.location;
}
const calendar = google.calendar({version: 'v3', auth: myGoogleAuth});
calendar.events.update({
auth: myGoogleAuth,