@nuskin/ns-product-lib 2.21.2-mdigi-9080.1 → 2.21.2-mdigi-9080.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.21.2-mdigi-9080.1",
3
+ "version": "2.21.2-mdigi-9080.2",
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": {
@@ -70,7 +70,7 @@ async function getProducts(ids, market, locale, config) {
70
70
  }
71
71
 
72
72
  const okta = typeof sessionStorage !== 'undefined' ? parseOktaObject(sessionStorage.oktaTokens) : null;
73
-
73
+ let finalIds= ids;
74
74
  try {
75
75
  const uniqueProduct = getUniqueProduct()
76
76
  const productsList = uniqueProduct && uniqueProduct.products ? uniqueProduct.products : [];
@@ -78,7 +78,7 @@ async function getProducts(ids, market, locale, config) {
78
78
  .map(item => item && item.sku ? item.sku : null)
79
79
  .filter(Boolean)
80
80
  .map(String);
81
- const finalIds = idValue.length ? idValue : ids;
81
+ finalIds = idValue.length ? idValue : ids;
82
82
  console.log("the value is of Id is ...... "+idValue)
83
83
  const data = await productLib.getProductsById(
84
84
  finalIds, market, locale,
@@ -86,7 +86,7 @@ async function getProducts(ids, market, locale, config) {
86
86
  config.graphqlUrl.includes('test') ? 'test' : config.graphqlUrl.includes('dev') ? 'dev' : 'prod'
87
87
  );
88
88
  if (data && data.products) {
89
- const mappedProducts = mapSkusToProducts(ids,data.products);
89
+ const mappedProducts = mapSkusToProducts(finalIds,data.products);
90
90
  //use to get default variant based on requested sku
91
91
  for (const {sku, product} of mappedProducts) {
92
92
  config.sku = sku;
@@ -96,7 +96,7 @@ async function getProducts(ids, market, locale, config) {
96
96
  productsData.count = productsData.products.length;
97
97
  }
98
98
  } catch (e) {
99
- console.log(`Unable to fetch products details for SKUs ${ids}`);
99
+ console.log(`Unable to fetch products details for SKUs ${finalIds}`);
100
100
  }
101
101
 
102
102
  return {