cosmicjs / unft-marketplace

A digital art marketplace built using Next.js, Stripe, and Cosmic.
https://cosmic-nextjs-marketplace.vercel.app
MIT License
66 stars 44 forks source link

Update cosmic module #13

Closed naira-ge closed 2 years ago

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
unft-marketplace ✅ Ready (Inspect) Visit Preview Sep 5, 2022 at 6:05PM (UTC)
jazibsawar commented 2 years ago

I think the only issue is with the categories fetching using Promise.all

Change it to this and it should work:

  let categoriesData = []
  for (const categoryType of categoryTypes) {
    categoriesData.push(await getDataByCategory(categoryType?.id))
  }

cc @jazibsawar

I've opened a PR for the fix in the cosmic module. Promise.all will perform the requests parallelly which in my opinion is a better approach in this scenario.