Optimize preview image size

This commit is contained in:
Michael Bromley 2021-01-25 21:31:25 +01:00
parent d4e8105ce0
commit 16d288cfe8
2 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ export function normalizeSearchResult(item: SearchResultFragment): Product {
description: item.description,
slug: item.slug,
path: item.slug,
images: [{ url: item.productAsset?.preview || '' }],
images: [{ url: item.productAsset?.preview + '?preset=medium' || '' }],
variants: [],
price: {
value: (item.priceWithTax as any).min / 100,
@ -100,7 +100,7 @@ export function normalizeCart(order: CartFragment): Cart {
url: l.productVariant.product.slug,
variantId: l.productVariant.id,
productId: l.productVariant.productId,
images: [{ url: l.featuredAsset?.preview || '' }],
images: [{ url: l.featuredAsset?.preview + '?preset=thumb' || '' }],
prices: [],
})),
}

View File

@ -74,7 +74,7 @@ async function getProduct({
},
options: product.optionGroups.map((og: any) => ({
displayName: og.name,
values: og.options.map((o: any) => ({ label: o.name + ' hello' })),
values: og.options.map((o: any) => ({ label: o.name })),
})),
},
}