Skip to content

Commit

Permalink
Check if sku has sellers (#107)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia authored Jun 3, 2023
1 parent f21df1f commit 27f1161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packs/vtex/utils/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export const toProduct = <P extends LegacyProductVTEX | ProductVTEX>(
? toAdditionalPropertiesLegacy(sku)
: toAdditionalProperties(sku);
const images = nonEmptyArray(sku.images) ?? [DEFAULT_IMAGE];
const offers = sku.sellers.map(toOffer).sort(bestOfferFirst);
const offers = (sku.sellers ?? []).map(toOffer).sort(bestOfferFirst);
const highPriceIndex = getHighPriceIndex(offers);
const lowPriceIndex = 0;

Expand Down

0 comments on commit 27f1161

Please sign in to comment.