Fix some broken types

Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
Chloe 2022-04-26 16:35:01 +07:00
parent 999dae22d5
commit f5f8d7bd8b
2 changed files with 5 additions and 9 deletions

View File

@ -1,10 +1,4 @@
{ {
"provider": "opencommerce", "provider": "opencommerce",
"features": { "features": {}
"wishlist": false,
"cart": false,
"search": false,
"customerAuth": false,
"customCheckout": false
}
} }

View File

@ -48,7 +48,7 @@ export function normalizeProduct(
images: media?.length images: media?.length
? normalizeProductImages(<ImageInfo[]>media, title ?? '') ? normalizeProductImages(<ImageInfo[]>media, title ?? '')
: [], : [],
vendor: product.vendor ?? undefined, ...(product.vendor ? { vendor: product.vendor } : {}),
price: { price: {
value: pricing[0]?.minPrice ?? 0, value: pricing[0]?.minPrice ?? 0,
currencyCode: pricing[0]?.currency.code, currencyCode: pricing[0]?.currency.code,
@ -175,7 +175,9 @@ const normalizeProductOption = (variant: CatalogProductVariant) => {
__typename: 'MultipleChoiceOption', __typename: 'MultipleChoiceOption',
id: variant._id, id: variant._id,
displayName: variant.attributeLabel, displayName: variant.attributeLabel,
values: variant.optionTitle ? [{ label: variant.optionTitle }] : [], values: variant.optionTitle
? [{ label: variant.optionTitle }]
: [{ label: '' }],
} }
option.values = option.values.map((value) => option.values = option.values.map((value) =>
colorizeProductOptionValue(value, option.displayName) colorizeProductOptionValue(value, option.displayName)