4
0
forked from crowetic/commerce

avoid malformed url with vendure (#622)

This commit is contained in:
Emilien Durieu 2021-12-22 20:44:26 +01:00 committed by GitHub
parent 4b2df2242c
commit c95f292743
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,13 @@ export function normalizeSearchResult(item: SearchResultFragment): Product {
description: item.description,
slug: item.slug,
path: item.slug,
images: [{ url: item.productAsset?.preview + '?w=800&mode=crop' || '' }],
images: [
{
url: item.productAsset?.preview
? item.productAsset?.preview + '?w=800&mode=crop'
: '',
},
],
variants: [],
price: {
value: (item.priceWithTax as any).min / 100,