Skip to content

Commit

Permalink
Merge 58f6194 into c14bed5
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsobol committed Mar 25, 2021
2 parents c14bed5 + 58f6194 commit befbab7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/commercetools/composables/src/getters/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ import { ProductVariant, ProductPrice, DiscountedProductPriceValue, LineItem } f
import { DiscountedLineItemPrice } from '../types/GraphQL';

export const getAttributeValue = (attribute) => {

/**
* List of attribute types: https://docs.commercetools.com/api/projects/productTypes#attributetype
*/
switch (attribute.attributeDefinition.type.name) {
case 'text':
case 'ltext':
case 'boolean':
case 'number':
case 'date':
case 'time':
case 'datetime':
case 'money':
case 'set':
return attribute.value;

case 'lenum':
Expand All @@ -20,9 +26,6 @@ export const getAttributeValue = (attribute) => {
case 'reference':
return { typeId: attribute.value.typeId, id: attribute.value.id };

case 'ltext':
return attribute.value;

default:
return null;
}
Expand Down
8 changes: 8 additions & 0 deletions packages/core/docs/changelog/5708.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
description: 'Fixed mapping for product attributes with type `set`',
link: 'https://github.com/vuestorefront/vue-storefront/pull/5708',
isBreaking: false,
breakingChanges: [],
author: 'Filip Sobol',
linkToGitHubAccount: 'https://github.com/filipsobol'
};

0 comments on commit befbab7

Please sign in to comment.