From 7c01cfc964421494bfbfdb823375c2b0c2a741f1 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Tue, 29 Oct 2024 02:35:10 +0300 Subject: [PATCH] get rid of end point to refresh merged calender using the refresh button --- server.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/server.js b/server.js index 1318f3d..cfb0c90 100644 --- a/server.js +++ b/server.js @@ -162,7 +162,7 @@ app.get('/calendar/:name', async (req, res) => { // Save the calendar to a file fs.writeFileSync(icsFilePath, calendar.toString()); - console.log('Calendar data refreshed.'); + console.log('Calendar data refreshed.'); } } else { return res.status(404).json({ error: 'Calendar not found.' }); @@ -271,19 +271,6 @@ END:VEVENT } } -// Endpoint to refresh the merged calendar -app.post('/refresh/:id', async (req, res) => { - const calendarId = req.params.id; - try { - await updateMergedCalendars(calendarId); - res.json({ message: `Merged calendar refreshed: ${calendarId}` }); - } catch (error) { - console.error(error); - res.status(500).json({ error: `Failed to refresh merged calendar: ${calendarId}` }); - } -}); - - // Start the server const port = 3000; app.listen(port, () => {