1
0
Fork 0

create function to santize the linkGroupName for use as a filename

This commit is contained in:
Ryan Mwangi 2024-10-28 15:02:13 +03:00
parent 0f5563ab2a
commit ad4f2faaca
1 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,11 @@ app.get('/', (req, res) => {
res.sendFile('index.html', { root: '.' }); res.sendFile('index.html', { root: '.' });
}); });
// Function to sanitize the linkGroupName for use as a filename
function sanitizeFilename(filename) {
return filename.replace(/[<>:"/\\|?*]/g, '_'); // Replace invalid characters with underscores
}
// Merge calendars endpoint // Merge calendars endpoint
app.post('/merge', async (req, res) => { app.post('/merge', async (req, res) => {
const { linkGroupName, calendars } = req.body; const { linkGroupName, calendars } = req.body;