@nuskin/ns-product-lib 2.17.7-cx24-7022.2 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.17.7-cx24-7022.2",
3
+ "version": "2.17.7-cx24-7022.3",
4
4
  "description": "This project contains shared Product models and code between the backend and frontend.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -144,7 +144,7 @@ async function getProducts(ids, market, locale, config) {
144
144
  */
145
145
 
146
146
  function mapSkusToProducts(skus , products){
147
- let newSkus = skus.filter((n) => {
147
+ let newProducts = products.data.productsById.products.filter((n) => {
148
148
  return n.id != null
149
149
  })
150
150
  const productsData = [];
@@ -153,8 +153,8 @@ function mapSkusToProducts(skus , products){
153
153
  products.data.productsById &&
154
154
  products.data.productsById.products &&
155
155
  products.data.productsById.products.length) {
156
- newSkus.forEach((sku)=>{
157
- const matchedProducts = products.data.productsById.products.filter((product)=>{
156
+ skus.forEach((sku)=>{
157
+ const matchedProducts = newProducts.filter((product)=>{
158
158
  let matched = false;
159
159
  if(product.id) {matched = product.id === sku;}
160
160
  if(product.variants.length){