@openinc/parse-server-opendash 3.25.0 → 3.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34,8 +34,8 @@ async function init() {
|
|
|
34
34
|
template?.relation("sources").remove(source);
|
|
35
35
|
await template?.save(null, { useMasterKey: true });
|
|
36
36
|
// Delete associated calendar event
|
|
37
|
-
if (object.get("meta")?.
|
|
38
|
-
await new CalendarManager_1.CalendarManager().deleteEvent(object.get("meta")?.
|
|
37
|
+
if (object.get("meta")?.microsoftCalendarEventId) {
|
|
38
|
+
await new CalendarManager_1.CalendarManager().deleteEvent(object.get("meta")?.microsoftCalendarEventId);
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
}
|
|
@@ -58,10 +58,10 @@ async function updateCalendarEvent(schedule) {
|
|
|
58
58
|
return;
|
|
59
59
|
const calendarManager = new CalendarManager_1.CalendarManager();
|
|
60
60
|
const meta = schedule.get("meta") || {};
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
61
|
+
const microsoftCalendarEventId = meta.microsoftCalendarEventId;
|
|
62
|
+
if (microsoftCalendarEventId) {
|
|
63
63
|
console.log("Updating schedule in calendar...");
|
|
64
|
-
await calendarManager.updateEvent(
|
|
64
|
+
await calendarManager.updateEvent(microsoftCalendarEventId, event);
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
67
67
|
await addToCalendar(schedule);
|
|
@@ -82,7 +82,7 @@ async function addToCalendar(schedule) {
|
|
|
82
82
|
const existingMeta = schedule.get("meta") || {};
|
|
83
83
|
schedule.set("meta", {
|
|
84
84
|
...existingMeta,
|
|
85
|
-
|
|
85
|
+
microsoftCalendarEventId: createdEvent.id,
|
|
86
86
|
});
|
|
87
87
|
await schedule.save(null, { useMasterKey: true });
|
|
88
88
|
}
|