From f34f88367b6b9c2ae10dfa1dc1c6b3ca851ebe7d Mon Sep 17 00:00:00 2001 From: sujal <117587914+sujal-98@users.noreply.github.com> Date: Fri, 31 May 2024 15:21:09 +0530 Subject: [PATCH] Update NasaProjects.jsx --- src/pages/NasaProjects/NasaProjects.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/NasaProjects/NasaProjects.jsx b/src/pages/NasaProjects/NasaProjects.jsx index b38c177..9127ca1 100644 --- a/src/pages/NasaProjects/NasaProjects.jsx +++ b/src/pages/NasaProjects/NasaProjects.jsx @@ -117,7 +117,7 @@ function TechNews() { const allProjects = []; for (const chunk of projectChunks) { - const projectPromises = chunk.map(async (id) => { + const projectPromises = chunk.map(async (id) => { //using map for concurrent execution of data let response = await fetch(`https://inplace-ghib.onrender.com/inplace`, { method: "POST", body: JSON.stringify({ @@ -132,7 +132,7 @@ function TechNews() { return { projectId, title, acronym, description, startDateString, endDateString, lastUpdated, statusDescription }; }); - const projects = await Promise.all(projectPromises); + const projects = await Promise.all(projectPromises); //waits for all promise to resolve allProjects.push(...projects); // Update state after processing each chunk @@ -268,4 +268,4 @@ function TechNews() { ) } -export default TechNews \ No newline at end of file +export default TechNews