pinelab-storefront-client
Advanced tools
Comparing version 0.44.2 to 0.44.3
@@ -48,11 +48,8 @@ 'use strict'; | ||
[ | ||
'\n ', | ||
'\n {\n Vendure {\n collections {\n items {\n id\n name\n slug\n description\n parent {\n id\n name\n slug\n }\n children {\n id\n name\n slug\n }\n featuredAsset {\n preview\n thumbnail\n }\n productVariants {\n items {\n product {\n ...ProductFields\n }\n }\n }\n }\n }\n }\n }\n', | ||
'\n {\n Vendure {\n collections {\n items {\n id\n name\n slug\n description\n parent {\n id\n name\n slug\n }\n children {\n id\n name\n slug\n }\n featuredAsset {\n preview\n thumbnail\n }\n productVariants {\n items {\n product {\n id\n name\n slug\n }\n }\n }\n }\n }\n }\n }\n', | ||
], | ||
[ | ||
'\n ', | ||
'\n {\n Vendure {\n collections {\n items {\n id\n name\n slug\n description\n parent {\n id\n name\n slug\n }\n children {\n id\n name\n slug\n }\n featuredAsset {\n preview\n thumbnail\n }\n productVariants {\n items {\n product {\n ...ProductFields\n }\n }\n }\n }\n }\n }\n }\n', | ||
'\n {\n Vendure {\n collections {\n items {\n id\n name\n slug\n description\n parent {\n id\n name\n slug\n }\n children {\n id\n name\n slug\n }\n featuredAsset {\n preview\n thumbnail\n }\n productVariants {\n items {\n product {\n id\n name\n slug\n }\n }\n }\n }\n }\n }\n }\n', | ||
] | ||
)), | ||
exports.PRODUCT_FIELDS | ||
)) | ||
); | ||
@@ -59,0 +56,0 @@ exports.GET_AVAILABLE_COUNTRIES = graphql_request_1.gql( |
@@ -7,2 +7,3 @@ import { CalculatedProduct } from '../'; | ||
Country, | ||
Product, | ||
ProductList, | ||
@@ -26,3 +27,6 @@ } from '../generated/graphql'; | ||
*/ | ||
getProductsForCollection(collection: Collection): CalculatedProduct[]; | ||
getProductsForCollection( | ||
collection: Collection, | ||
allProducts: Product[] | ||
): CalculatedProduct[]; | ||
getAllCollections(): Promise<CollectionList>; | ||
@@ -29,0 +33,0 @@ getAllProducts(): Promise<ProductList>; |
@@ -196,3 +196,6 @@ 'use strict'; | ||
) { | ||
var products = _this.getProductsForCollection(collection); | ||
var products = _this.getProductsForCollection( | ||
collection, | ||
productList.items | ||
); | ||
return { | ||
@@ -224,8 +227,15 @@ collection: __assign(__assign({}, collection), { | ||
*/ | ||
GridsomeService.prototype.getProductsForCollection = function (collection) { | ||
var productsPerCollection = collection.productVariants.items.map(function ( | ||
variant | ||
) { | ||
return variant.product; | ||
}); | ||
GridsomeService.prototype.getProductsForCollection = function ( | ||
collection, | ||
allProducts | ||
) { | ||
var productsPerCollection = collection.productVariants.items | ||
.map(function (variant) { | ||
return allProducts.find(function (product) { | ||
return product.id === variant.product.id; | ||
}); | ||
}) | ||
.filter(function (product) { | ||
return !!product; | ||
}); | ||
productsPerCollection = __1.deduplicate(productsPerCollection); | ||
@@ -232,0 +242,0 @@ return productsPerCollection.map(function (p) { |
{ | ||
"name": "pinelab-storefront-client", | ||
"version": "0.44.2", | ||
"version": "0.44.3", | ||
"description": "Generates static html pages with Gridsome and suplied Vue components", | ||
@@ -50,3 +50,3 @@ "author": "Martijn van de Brug <martijn@pinelab.studio>", | ||
}, | ||
"gitHead": "ad184e5647638a78e3e3f3de30d4d899c6db9aeb" | ||
"gitHead": "7e2815bbd142398e8dcb0407b4188b4a741b4ff0" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
623796
7943