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
|
- Send address update mutation only once - #210 by @dominik-zeglen
|
||||||
- Update sale details design - #207 by @dominik-zeglen
|
- Update sale details design - #207 by @dominik-zeglen
|
||||||
- Improve autocomplete UX - #212 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(
|
export function getAttributeInputFromVariant(
|
||||||
product: ProductVariant
|
variant: ProductVariant
|
||||||
): VariantAttributeInput[] {
|
): VariantAttributeInput[] {
|
||||||
return maybe(
|
return maybe(
|
||||||
(): VariantAttributeInput[] =>
|
(): VariantAttributeInput[] =>
|
||||||
product.attributes.map(attribute => ({
|
variant.attributes.map(attribute => ({
|
||||||
data: {
|
data: {
|
||||||
values: attribute.attribute.values
|
values: attribute.attribute.values
|
||||||
},
|
},
|
||||||
id: attribute.attribute.id,
|
id: attribute.attribute.id,
|
||||||
label: attribute.attribute.name,
|
label: attribute.attribute.name,
|
||||||
value: attribute.value.slug
|
value: maybe(() => attribute.value.slug, null)
|
||||||
})),
|
})),
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue