From 2d3c90aa38686bd60b4a458d95ed654a26e4d337 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Fri, 18 Oct 2024 15:36:30 +0300 Subject: [PATCH] generate URL for merged calendar using calendar ID --- server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index ab28c12..6c6a86a 100644 --- a/server.js +++ b/server.js @@ -89,11 +89,11 @@ END:VEVENT `; }); icalString += `END:VCALENDAR`; - fs.writeFileSync(filename, icalString); + fs.writeFileSync(`${MERGED_CALENDARS_DIR}/${filename}`, icalString); - // Generate a unique URL for the merged calendar - const mergedCalendarUrl = `${req.protocol}://${req.get('host')}/${filename}`; + // Generate URL for the merged calendar + const mergedCalendarUrl = `${req.protocol}://${req.get('host')}/calendar/${calendarId}`; // Save the user input in a calendars.json file const calendarsFile = 'calendars.json';