Fix normalizer, since assets is optional now.

This commit is contained in:
Catalin Pinte 2022-11-15 08:52:29 +02:00
parent c75b0fc001
commit f4da360f12

View File

@ -61,10 +61,11 @@ export function normalizeProduct(
descriptionHtml: description,
slug: permalink,
path: `/${permalink}`,
images: assets.map(({ url, description, filename }) => ({
images:
assets?.map(({ url, description, filename }) => ({
url,
alt: description || filename,
})),
})) || [],
price: {
value: price.raw,
currencyCode: 'USD',