Resolve if can't find event on google cal (#2860)
* Resolve if can't find event on google cal * Change order of console.error Co-authored-by: Omar López <zomars@me.com> Co-authored-by: Omar López <zomars@me.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>pull/2880/head^2
parent
07aa2e88a1
commit
e16eee68b0
|
@ -102,10 +102,13 @@ export default class GoogleCalendarService implements Calendar {
|
|||
dateTime: calEventRaw.endTime,
|
||||
timeZone: calEventRaw.organizer.timeZone,
|
||||
},
|
||||
attendees: [{...calEventRaw.organizer, organizer: true }, ... calEventRaw.attendees.map((attendee) => ({
|
||||
...attendee,
|
||||
responseStatus: "accepted",
|
||||
}))],
|
||||
attendees: [
|
||||
{ ...calEventRaw.organizer, organizer: true },
|
||||
...calEventRaw.attendees.map((attendee) => ({
|
||||
...attendee,
|
||||
responseStatus: "accepted",
|
||||
})),
|
||||
],
|
||||
reminders: {
|
||||
useDefault: true,
|
||||
},
|
||||
|
@ -235,8 +238,10 @@ export default class GoogleCalendarService implements Calendar {
|
|||
},
|
||||
function (err: GoogleCalError | null, event) {
|
||||
if (err) {
|
||||
if (err.code === 410) resolve();
|
||||
/* 410 is when an event is already deleted on the Google cal before on cal.com
|
||||
404 is when the event is on a different calendar */
|
||||
console.error("There was an error contacting google calendar service: ", err);
|
||||
if (err.code === (410 || 404)) return resolve();
|
||||
return reject(err);
|
||||
}
|
||||
return resolve(event?.data);
|
||||
|
|
Loading…
Reference in New Issue