Skip to content

Commit

Permalink
fix: force https for images
Browse files Browse the repository at this point in the history
  • Loading branch information
dylandepass committed Nov 3, 2024
1 parent e98d8bb commit 85e0560
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/content/queries/cs-product.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const adapter = (productData) => {
} else if (maxPrice == null) {
maxPrice = minPrice;
}

/** @type {Product} */
const product = {
sku: productData.sku,
Expand All @@ -40,7 +39,7 @@ export const adapter = (productData) => {
addToCartAllowed: productData.addToCartAllowed,
inStock: productData.inStock,
externalId: productData.externalId,
images: productData.images ?? [],
images: productData.images?.filter((img) => img.url.replace('http://', 'https://')) ?? [],
attributes: productData.attributes ?? [],
options: (productData.options ?? []).map((option) => ({
id: option.id,
Expand Down
2 changes: 1 addition & 1 deletion src/content/queries/cs-variants.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const adapter = (config, variants) => variants.map(({ selections, product
description: product.description,
url: product.url,
inStock: product.inStock,
images: product.images ?? [],
images: product.images?.filter((img) => img.url.replace('http://', 'https://')) ?? [],
attributes: product.attributes ?? [],
externalId: product.externalId,
prices: {
Expand Down

0 comments on commit 85e0560

Please sign in to comment.