From 6e18a245a91a2f7d6dc68f18e7bd4cc0aceb8432 Mon Sep 17 00:00:00 2001 From: Tiago Gimenes Date: Mon, 21 Feb 2022 11:48:41 -0300 Subject: [PATCH] remove unecessary logs --- .../platforms/vtex/resolvers/collection.ts | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/packages/api/src/platforms/vtex/resolvers/collection.ts b/packages/api/src/platforms/vtex/resolvers/collection.ts index 90627ba180..537156038d 100644 --- a/packages/api/src/platforms/vtex/resolvers/collection.ts +++ b/packages/api/src/platforms/vtex/resolvers/collection.ts @@ -76,23 +76,17 @@ export const StoreCollection: Record> = { 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, } }, }