Skip to content

Commit

Permalink
remove unecessary logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tlgimenes committed Feb 21, 2022
1 parent b54ec72 commit 6e18a24
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions packages/api/src/platforms/vtex/resolvers/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,17 @@ export const StoreCollection: Record<string, Resolver<Root>> = {
segments.slice(0, index + 1).join('/')
)

try {
const collections = await Promise.all(
slugs.map((s) => collectionLoader.load(s))
)

return {
itemListElement: collections.map((collection, index) => ({
item: new URL(`https://${collection.url}`).pathname.toLowerCase(),
name: collection.name,
position: index + 1,
})),
numberOfItems: collections.length,
}
} catch (err) {
console.error({ slug, root, segments, slugs })
const collections = await Promise.all(
slugs.map((s) => collectionLoader.load(s))
)

throw err
return {
itemListElement: collections.map((collection, index) => ({
item: new URL(`https://${collection.url}`).pathname.toLowerCase(),
name: collection.name,
position: index + 1,
})),
numberOfItems: collections.length,
}
},
}

0 comments on commit 6e18a24

Please sign in to comment.