From d2d0f7fd1ed8ae50dba97022745cd14a1856ac06 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Thu, 24 Oct 2024 15:28:13 +0300 Subject: [PATCH] filter out any failed requests --- server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server.js b/server.js index db55e5a..1e6a4ce 100644 --- a/server.js +++ b/server.js @@ -141,6 +141,10 @@ app.get('/calendar/:name', async (req, res) => { return null; }); }); + + const results = await Promise.all(promises); + // Filter out any failed requests + const validResults = results.filter((result) => result !== null); } } } catch (error) {