get rid of end point to refresh merged calender using the refresh button
This commit is contained in:
parent
8031333bce
commit
7c01cfc964
15
server.js
15
server.js
|
@ -162,7 +162,7 @@ app.get('/calendar/:name', async (req, res) => {
|
||||||
// Save the calendar to a file
|
// Save the calendar to a file
|
||||||
fs.writeFileSync(icsFilePath, calendar.toString());
|
fs.writeFileSync(icsFilePath, calendar.toString());
|
||||||
|
|
||||||
console.log('Calendar data refreshed.');
|
console.log('Calendar data refreshed.');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return res.status(404).json({ error: 'Calendar not found.' });
|
return res.status(404).json({ error: 'Calendar not found.' });
|
||||||
|
@ -271,19 +271,6 @@ END:VEVENT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Endpoint to refresh the merged calendar
|
|
||||||
app.post('/refresh/:id', async (req, res) => {
|
|
||||||
const calendarId = req.params.id;
|
|
||||||
try {
|
|
||||||
await updateMergedCalendars(calendarId);
|
|
||||||
res.json({ message: `Merged calendar refreshed: ${calendarId}` });
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
res.status(500).json({ error: `Failed to refresh merged calendar: ${calendarId}` });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// Start the server
|
// Start the server
|
||||||
const port = 3000;
|
const port = 3000;
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
|
|
Loading…
Reference in New Issue