mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 13:41:22 +00:00
Optimize preview image size
This commit is contained in:
parent
d4e8105ce0
commit
16d288cfe8
@ -75,7 +75,7 @@ export function normalizeSearchResult(item: SearchResultFragment): Product {
|
|||||||
description: item.description,
|
description: item.description,
|
||||||
slug: item.slug,
|
slug: item.slug,
|
||||||
path: item.slug,
|
path: item.slug,
|
||||||
images: [{ url: item.productAsset?.preview || '' }],
|
images: [{ url: item.productAsset?.preview + '?preset=medium' || '' }],
|
||||||
variants: [],
|
variants: [],
|
||||||
price: {
|
price: {
|
||||||
value: (item.priceWithTax as any).min / 100,
|
value: (item.priceWithTax as any).min / 100,
|
||||||
@ -100,7 +100,7 @@ export function normalizeCart(order: CartFragment): Cart {
|
|||||||
url: l.productVariant.product.slug,
|
url: l.productVariant.product.slug,
|
||||||
variantId: l.productVariant.id,
|
variantId: l.productVariant.id,
|
||||||
productId: l.productVariant.productId,
|
productId: l.productVariant.productId,
|
||||||
images: [{ url: l.featuredAsset?.preview || '' }],
|
images: [{ url: l.featuredAsset?.preview + '?preset=thumb' || '' }],
|
||||||
prices: [],
|
prices: [],
|
||||||
})),
|
})),
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ async function getProduct({
|
|||||||
},
|
},
|
||||||
options: product.optionGroups.map((og: any) => ({
|
options: product.optionGroups.map((og: any) => ({
|
||||||
displayName: og.name,
|
displayName: og.name,
|
||||||
values: og.options.map((o: any) => ({ label: o.name + ' hello' })),
|
values: og.options.map((o: any) => ({ label: o.name })),
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user