mirror of
https://github.com/urosran/cally.git
synced 2025-11-27 00:44:54 +00:00
notification update
This commit is contained in:
@ -24,6 +24,11 @@ exports.sendNotificationOnEventCreation = functions.firestore
|
|||||||
const eventData = snapshot.data();
|
const eventData = snapshot.data();
|
||||||
const { familyId, creatorId, email, title } = eventData;
|
const { familyId, creatorId, email, title } = eventData;
|
||||||
|
|
||||||
|
if (!!eventData?.externalOrigin) {
|
||||||
|
console.log('Externally synced event, ignoring.')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!familyId || !creatorId) {
|
if (!familyId || !creatorId) {
|
||||||
console.error('Missing familyId or creatorId in event data');
|
console.error('Missing familyId or creatorId in event data');
|
||||||
return;
|
return;
|
||||||
@ -636,7 +641,8 @@ async function fetchAndSaveGoogleEvents({ token, refreshToken, email, familyId,
|
|||||||
allDay: !item.start?.dateTime,
|
allDay: !item.start?.dateTime,
|
||||||
familyId,
|
familyId,
|
||||||
email,
|
email,
|
||||||
creatorId, // Add creatorId to each event
|
creatorId,
|
||||||
|
externalOrigin: "google",
|
||||||
};
|
};
|
||||||
events.push(googleEvent);
|
events.push(googleEvent);
|
||||||
console.log(`Processed event: ${JSON.stringify(googleEvent)}`);
|
console.log(`Processed event: ${JSON.stringify(googleEvent)}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user