Merge pull request #218 from mirumee/fix/new-variant-attributes
Fix empty attribute values
This commit is contained in:
commit
cce276db3a
2 changed files with 4 additions and 4 deletions
|
@ -39,4 +39,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
|
||||
|
|
|
@ -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)
|
||||
})),
|
||||
[]
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue