Skip to content

Commit f049ab5

Browse files
committed
fix: pass imageRoleOrder
1 parent 617723e commit f049ab5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/content/queries/cs-product.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ function extractMinMaxPrice(data) {
3737
*/
3838
export const adapter = (config, productData) => {
3939
const { minPrice, maxPrice } = extractMinMaxPrice(productData);
40-
const images = sortImagesByRole(forceImagesHTTPS(productData.images) ?? []);
40+
const images = sortImagesByRole(
41+
forceImagesHTTPS(productData.images)
42+
?? [],
43+
config.imageRoleOrder,
44+
);
4145

4246
/** @type {Product} */
4347
const product = {

src/content/queries/cs-variants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const adapter = (config, variants) => variants.map(({ selections, product
2727
const minPrice = product.priceRange?.minimum ?? product.price;
2828
const maxPrice = product.priceRange?.maximum ?? product.price;
2929

30-
const images = sortImagesByRole(forceImagesHTTPS(product.images) ?? []);
30+
const images = sortImagesByRole(forceImagesHTTPS(product.images) ?? [], config.imageRoleOrder);
3131

3232
/** @type {Variant} */
3333
const variant = {

0 commit comments

Comments
 (0)