Skip to content

Commit

Permalink
avoid throw on related legacy products
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgr committed Oct 4, 2024
1 parent 46e0de2 commit 31ea22f
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions vtex/loaders/legacy/relatedProductsLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ async function loader(
}, { ...STALE, headers: withSegmentCookie(segment) })
.then((res) => res.json());

if (products && !Array.isArray(products)) {
throw new Error(
`Error while fetching VTEX data ${JSON.stringify(products)}`,
);
}

// unique Ids
const relatedIds = [...new Set(
products.slice(0, count).map((p) => pickSku(p).itemId),
Expand Down

0 comments on commit 31ea22f

Please sign in to comment.