From bee833e80e5828ba7e444aecbdec8cb39343ef25 Mon Sep 17 00:00:00 2001 From: Sebastian Rindom Date: Mon, 31 Aug 2020 20:45:51 +0200 Subject: [PATCH] pull thumbs from contentful --- .../medusa-plugin-contentful/src/services/contentful.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/medusa-plugin-contentful/src/services/contentful.js b/packages/medusa-plugin-contentful/src/services/contentful.js index 74c416454a..5e4227814f 100644 --- a/packages/medusa-plugin-contentful/src/services/contentful.js +++ b/packages/medusa-plugin-contentful/src/services/contentful.js @@ -267,8 +267,14 @@ class ContentfulService extends BaseService { this.redis_.set("product_ignore_ids", JSON.stringify(ignoreIds)) } + // Get the thumbnail + const thumb = await environment.getAsset( + entry.fields.thumbnail["en-US"].sys.id + ) + const updatedProduct = await this.productService_.update(productId, { title: productEntry.fields.title["en-US"], + thumbnail: thumb.fields.file["en-US"].url, }) return updatedProduct