This commit is contained in:
Belen Curcio
2021-01-10 15:55:11 -03:00
parent 92a2388bd1
commit 0a05182f3b
6 changed files with 43 additions and 45 deletions

View File

@@ -34,12 +34,10 @@ function productsNormalizer(arr: any[]): Product[] {
),
variants: variants.edges.map(({ node }: any) => node),
productOptions: productOptions.edges.map(({ node }: any) => node),
prices: [
{
value: prices.price.value,
currencyCode: prices.price.currencyCode,
},
],
price: {
value: prices.price.value,
currencyCode: prices.price.currencyCode,
},
...rest,
})
)

View File

@@ -6,7 +6,7 @@ interface Product {
path?: string
images: ProductImage[]
variants: ProductVariant[]
prices: ProductPrice[]
price: ProductPrice
}
interface ProductImage {
url: string
@@ -18,9 +18,10 @@ interface ProductVariant {
}
interface ProductPrice {
value: number | string
value: number
currencyCode: 'USD' | 'ARS'
type?: 'price' | 'retail' | 'sale' | string
retailValue?: number
saleValue?: number
}
interface Cart {