From 8066a0e7175d3e04aceb557a047c0649a0718976 Mon Sep 17 00:00:00 2001 From: olivermrbl Date: Thu, 8 Apr 2021 16:20:36 +0200 Subject: [PATCH] hotfix(medusa-plugin-contentful): Fixes image assets --- .../medusa-plugin-contentful/src/services/contentful.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/medusa-plugin-contentful/src/services/contentful.js b/packages/medusa-plugin-contentful/src/services/contentful.js index 5fed5759a4..f78d714073 100644 --- a/packages/medusa-plugin-contentful/src/services/contentful.js +++ b/packages/medusa-plugin-contentful/src/services/contentful.js @@ -76,7 +76,7 @@ class ContentfulService extends BaseService { let assets = [] await Promise.all( product.images - .filter((image) => image !== product.thumbnail) + .filter((image) => image.url !== product.thumbnail) .map(async (image, i) => { const asset = await environment.createAsset({ fields: { @@ -89,8 +89,8 @@ class ContentfulService extends BaseService { file: { "en-US": { contentType: "image/xyz", - fileName: image, - upload: image, + fileName: image.url, + upload: image.url, }, }, }, @@ -450,7 +450,7 @@ class ContentfulService extends BaseService { ] // Update came directly from product variant service so only act on a couple - // of fields. When the update comes from the product we want to ensure + // of fields. When the update comes from the product we want to ensure // references are set up correctly so we run through everything. if (variant.fields) { const found = variant.fields.find((f) => updateFields.includes(f))