mirror of
https://github.com/janoodleFTW/timy-messenger.git
synced 2026-01-23 02:14:39 +00:00
15 lines
No EOL
463 B
JavaScript
15 lines
No EOL
463 B
JavaScript
const functions = require('firebase-functions');
|
|
const { updateCalendarGroupName } = require('./calendar-update');
|
|
|
|
const updatedGroup = functions
|
|
.region('europe-west1')
|
|
.firestore
|
|
.document('/groups/{groupId}')
|
|
.onUpdate(async (change, context) => {
|
|
const groupAfter = change.after.data();
|
|
|
|
// Update Calendar
|
|
await updateCalendarGroupName(context.params.groupId, groupAfter.name);
|
|
});
|
|
|
|
module.exports = updatedGroup; |