From b4674feabf99175650eac6d74c1e243f60d21220 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Tue, 22 Oct 2024 02:40:08 +0300 Subject: [PATCH] endpoint to refresh the merged calender --- server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.js b/server.js index c4d2705..70b4874 100644 --- a/server.js +++ b/server.js @@ -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 cron.schedule('1 * * * *', () => { console.log('Updating merged calendar...');