Skip to content

Commit

Permalink
Update NasaProjects.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
sujal-98 authored May 31, 2024
1 parent a457d43 commit f34f883
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/NasaProjects/NasaProjects.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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
Expand Down Expand Up @@ -268,4 +268,4 @@ function TechNews() {
)
}

export default TechNews
export default TechNews

0 comments on commit f34f883

Please sign in to comment.