1
0
Fork 0

endpoint to refresh the merged calender

This commit is contained in:
Ryan Mwangi 2024-10-22 02:40:08 +03:00
parent 714a82575b
commit b4674feabf
1 changed files with 6 additions and 0 deletions

View File

@ -221,6 +221,12 @@ END:VEVENT
} }
} }
// Endpoint to refresh the merged calendar
app.post('/refresh/:id', async (req, res) => {
const calendarId = req.params.id;
await updateMergedCalendars(calendarId);
});
// Schedule a cron job to update the merged calendar every hour // Schedule a cron job to update the merged calendar every hour
cron.schedule('1 * * * *', () => { cron.schedule('1 * * * *', () => {
console.log('Updating merged calendar...'); console.log('Updating merged calendar...');