pull thumbs from contentful

This commit is contained in:
Sebastian Rindom
2020-08-31 20:45:51 +02:00
parent 22a2ad8725
commit bee833e80e

View File

@@ -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