add logging to ensure file saving logic is working

This commit is contained in:
Ryan Mwangi 2024-10-31 15:26:36 +03:00
parent 88ab9c53a1
commit 3f2fb01bf1
1 changed files with 3 additions and 1 deletions

View File

@ -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);