From 2dd54bc033d93947ae6b7c5a6e3390db3b326766 Mon Sep 17 00:00:00 2001 From: Marcin Sulowski Date: Tue, 28 Sep 2021 15:02:12 +0200 Subject: [PATCH] fix(ct): productType field omitted for custom queries (#6367) * fix(ct): productType field ommited for custom queries * fix(ct): CR - move changelog Co-authored-by: Marcin Sulowski --- .../composables/src/helpers/internals/enhanceProduct.ts | 3 ++- packages/core/docs/commercetools/changelog/6347.js | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 packages/core/docs/commercetools/changelog/6347.js diff --git a/packages/commercetools/composables/src/helpers/internals/enhanceProduct.ts b/packages/commercetools/composables/src/helpers/internals/enhanceProduct.ts index a0df506e50..ea8d6a34d3 100644 --- a/packages/commercetools/composables/src/helpers/internals/enhanceProduct.ts +++ b/packages/commercetools/composables/src/helpers/internals/enhanceProduct.ts @@ -37,7 +37,8 @@ const enhanceProduct = (productResponse: ApolloQueryResult, context _master: current.masterVariant.id === variant.id, _description: current.description, _categoriesRef: current.categoriesRef.map((cr) => cr.id), - _rating: (product as any).reviewRatingStatistics + _rating: (product as any).reviewRatingStatistics, + ...(product.productType && { _productType: product.productType }) })); }) .reduce((prev, curr) => [...prev, ...curr], []); diff --git a/packages/core/docs/commercetools/changelog/6347.js b/packages/core/docs/commercetools/changelog/6347.js new file mode 100644 index 0000000000..6c8d09a907 --- /dev/null +++ b/packages/core/docs/commercetools/changelog/6347.js @@ -0,0 +1,7 @@ +module.exports = { + description: 'getProduct custom query - productType doesnt get mapped to product response in enhanceProduct helper', + link: 'https://github.com/vuestorefront/vue-storefront/issues/6347', + isBreaking: false, + author: 'Marcin Sulowski', + linkToGitHubAccount: 'https://github.com/MarcinSulowski' +};