From 3f2fb01bf17d12d415d9de7118def9969ec2de2c Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Thu, 31 Oct 2024 15:26:36 +0300 Subject: [PATCH] add logging to ensure file saving logic is working --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index b90962d..b317372 100644 --- a/server.js +++ b/server.js @@ -100,7 +100,9 @@ app.post('/merge', async (req, res) => { // Save the calendar to a file - fs.writeFileSync(`${MERGED_CALENDARS_DIR}/${filename}`, calendar.toString()); + const filePath = `${MERGED_CALENDARS_DIR}/${filename}`; + fs.writeFileSync(filePath, calendar.toString()); + console.log(`Calendar saved to ${filePath}`); // Save the user input and sanitizedLinkGroupName in a separate JSON file saveCalendarData(sanitizedLinkGroupName, linkGroupName, calendars);