From 04b22ab878bbe004d4743b9d24b093052f753624 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Fri, 18 Oct 2019 13:19:43 +0200 Subject: [PATCH 1/2] Fix empty attribute values --- src/products/utils/data.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/products/utils/data.ts b/src/products/utils/data.ts index b1fc302fb..eb7827abb 100644 --- a/src/products/utils/data.ts +++ b/src/products/utils/data.ts @@ -93,17 +93,17 @@ export function getAttributeInputFromProductType( } export function getAttributeInputFromVariant( - product: ProductVariant + variant: ProductVariant ): VariantAttributeInput[] { return maybe( (): VariantAttributeInput[] => - product.attributes.map(attribute => ({ + variant.attributes.map(attribute => ({ data: { values: attribute.attribute.values }, id: attribute.attribute.id, label: attribute.attribute.name, - value: attribute.value.slug + value: maybe(() => attribute.value.slug, null) })), [] ); From 29f6f3601351ea0e028b0006d7f675379ef1c83e Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Fri, 18 Oct 2019 14:04:22 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 340fdb719..89f6d0f45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,3 +38,4 @@ All notable, unreleased changes to this project will be documented in this file. - Send address update mutation only once - #210 by @dominik-zeglen - Update sale details design - #207 by @dominik-zeglen - Improve autocomplete UX - #212 by @dominik-zeglen +- Fix empty attribute values - #218 by @dominik-zeglen