fix syntax error

This commit is contained in:
Ryan Mwangi 2024-10-19 17:13:45 +03:00
parent e6b63cd85f
commit d43a701051
1 changed files with 2 additions and 7 deletions

View File

@ -187,7 +187,7 @@ async function updateMergedCalendar(){
const results = await Promise.all(promises);
// Filter out any failed requests
const validResults = results.flat().filter((result) => result !== null);
const validResults = results.filter((result) => result !== null);
// Parse calendar data
const mergedCal = [];
@ -228,17 +228,12 @@ END:VEVENT
});
icalString += `END:VCALENDAR`;
fs.writeFileSync(filename, icalString);
// Generate a unique URL for the merged calendar
const mergedCalendarUrl = `http://localhost:3000/${filename}`;
// Store the merged calendar URL in a file
fs.writeFileSync(`${MERGED_CALENDARS_DIR}/${filename}`, icalString);
console.log(`Merged calendar updated: ${mergedCalendarUrl}`);
}
} catch (error) {
console.error(error);
}