Convert uid to google event uid format
parent
385421d250
commit
550e0ea488
|
@ -76,6 +76,7 @@ export default class GoogleCalendarService implements Calendar {
|
||||||
return new Promise((resolve, reject) =>
|
return new Promise((resolve, reject) =>
|
||||||
this.auth.getToken().then((myGoogleAuth) => {
|
this.auth.getToken().then((myGoogleAuth) => {
|
||||||
const payload: calendar_v3.Schema$Event = {
|
const payload: calendar_v3.Schema$Event = {
|
||||||
|
id: event.uid!.toLowerCase().replace(/[wxyz]/g, ""),
|
||||||
summary: event.title,
|
summary: event.title,
|
||||||
description: getRichDescription(event),
|
description: getRichDescription(event),
|
||||||
start: {
|
start: {
|
||||||
|
@ -117,6 +118,10 @@ export default class GoogleCalendarService implements Calendar {
|
||||||
conferenceDataVersion: 1,
|
conferenceDataVersion: 1,
|
||||||
},
|
},
|
||||||
function (err, event) {
|
function (err, event) {
|
||||||
|
console.log(
|
||||||
|
"🚀 ~ file: CalendarService.ts ~ line 120 ~ GoogleCalendarService ~ this.auth.getToken ~ event",
|
||||||
|
event
|
||||||
|
);
|
||||||
if (err || !event?.data) {
|
if (err || !event?.data) {
|
||||||
console.error("There was an error contacting google calendar service: ", err);
|
console.error("There was an error contacting google calendar service: ", err);
|
||||||
return reject(err);
|
return reject(err);
|
||||||
|
@ -172,7 +177,7 @@ export default class GoogleCalendarService implements Calendar {
|
||||||
calendarId: event.destinationCalendar?.externalId
|
calendarId: event.destinationCalendar?.externalId
|
||||||
? event.destinationCalendar.externalId
|
? event.destinationCalendar.externalId
|
||||||
: "primary",
|
: "primary",
|
||||||
eventId: uid,
|
eventId: uid.toLowerCase().replace(/[wxyz]/g, ""),
|
||||||
sendNotifications: true,
|
sendNotifications: true,
|
||||||
sendUpdates: "all",
|
sendUpdates: "all",
|
||||||
requestBody: payload,
|
requestBody: payload,
|
||||||
|
@ -203,7 +208,7 @@ export default class GoogleCalendarService implements Calendar {
|
||||||
calendarId: event.destinationCalendar?.externalId
|
calendarId: event.destinationCalendar?.externalId
|
||||||
? event.destinationCalendar.externalId
|
? event.destinationCalendar.externalId
|
||||||
: "primary",
|
: "primary",
|
||||||
eventId: uid,
|
eventId: uid.toLowerCase().replace(/[wxyz]/g, ""),
|
||||||
sendNotifications: true,
|
sendNotifications: true,
|
||||||
sendUpdates: "all",
|
sendUpdates: "all",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue