From da7a48dc635c5ec0fbeeadec70d39979f8b00847 Mon Sep 17 00:00:00 2001 From: anthony Date: Mon, 14 Feb 2022 09:19:29 +0100 Subject: [PATCH] Add missing await for Promise.all --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e99965a..107fdaa 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,7 @@ async function fetch3CatFacts() { const uri = `${CAT_API_ENDPOINT}/facts/random?amount=${CAT_FACTS_COUNT}`; try { const response = await axios.get(uri); + console.log() return response.data.map(rep => rep.text); } catch { return null; @@ -49,7 +50,7 @@ async function fetchDaysOfPerCountry(country) { app.post('/', async (req, _res) => { const countryCode = req.body?.countryCode; - const [foxPicture, catFacts, holidays] = Promise.all([ + const [foxPicture, catFacts, holidays] = await Promise.all([ fetchFowImage(), fetch3CatFacts(), fetchDaysOfPerCountry(countryCode)