@nuskin/ns-product-lib 2.17.7-cx24-7022.1 → 2.17.7-cx24-7022.3
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/graph-ql/product.js +4 -1
package/package.json
CHANGED
package/src/graph-ql/product.js
CHANGED
@@ -144,6 +144,9 @@ async function getProducts(ids, market, locale, config) {
|
|
144
144
|
*/
|
145
145
|
|
146
146
|
function mapSkusToProducts(skus , products){
|
147
|
+
let newProducts = products.data.productsById.products.filter((n) => {
|
148
|
+
return n.id != null
|
149
|
+
})
|
147
150
|
const productsData = [];
|
148
151
|
if (products &&
|
149
152
|
products.data &&
|
@@ -151,7 +154,7 @@ function mapSkusToProducts(skus , products){
|
|
151
154
|
products.data.productsById.products &&
|
152
155
|
products.data.productsById.products.length) {
|
153
156
|
skus.forEach((sku)=>{
|
154
|
-
const matchedProducts =
|
157
|
+
const matchedProducts = newProducts.filter((product)=>{
|
155
158
|
let matched = false;
|
156
159
|
if(product.id) {matched = product.id === sku;}
|
157
160
|
if(product.variants.length){
|