filter out failed requests

This commit is contained in:
Ryan Mwangi 2024-10-02 02:09:36 +03:00
parent c5b6fbaaaf
commit fa2dd50beb

View file

@ -37,6 +37,8 @@ app.post('/merge', async (req, res) => {
});
const results = await Promise.all(promises);
// Filter out any failed requests
const validResults = results.filter((result) => result !== null);
// Parse calendar data
const cal1 = ical.parseICS(cal1Data.data);