From 4584280eab255fc20e060b477ea11be33943edad Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Mon, 28 Oct 2024 20:57:34 +0300 Subject: [PATCH] save the calendar to a file --- server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index b81da3d..2fbc326 100644 --- a/server.js +++ b/server.js @@ -85,8 +85,9 @@ app.post('/merge', async (req, res) => { }); - fs.writeFileSync(`${MERGED_CALENDARS_DIR}/${filename}`, icalString); - + // Save the calendar to a file + fs.writeFileSync(`${MERGED_CALENDARS_DIR}/${filename}`, calendar.toString()); + // Save the user input and sanitizedLinkGroupName in a separate JSON file saveCalendarData(sanitizedLinkGroupName, linkGroupName, calendars);