@nuskin/ns-product-lib 2.6.0-cx24-3377.10 → 2.6.0-cx24-3377.12

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # [2.6.0-cx24-3377.12](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0-cx24-3377.11...v2.6.0-cx24-3377.12) (2023-03-10)
2
+
3
+
4
+ ### New
5
+
6
+ * Fix multiple variants not loading properly (CX24-3377) ([b66be37](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b66be37163a64c6fcc0d763b748a653d3fc0ebb9))
7
+ * Fix multiple variants not loading properly (CX24-3377) ([10821f1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/10821f1924f5f0d7b985af15d382948e99592e42))
8
+
9
+ # [2.6.0-cx24-3377.11](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0-cx24-3377.10...v2.6.0-cx24-3377.11) (2023-03-10)
10
+
11
+
12
+ ### New
13
+
14
+ * Fix multiple variants not loading properly (CX24-3377) ([9f8273b](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9f8273b5a8ae3aaf40fb417d04e2087b4b0f036b))
15
+
1
16
  # [2.6.0-cx24-3377.10](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0-cx24-3377.9...v2.6.0-cx24-3377.10) (2023-03-09)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.6.0-cx24-3377.10",
3
+ "version": "2.6.0-cx24-3377.12",
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": {
package/src/product.js CHANGED
@@ -429,8 +429,8 @@ const Product = function (productData) {
429
429
 
430
430
  this.isBase = function () {
431
431
  if (this.equinoxProductId != "") {
432
- if (this.sku == Object.keys(this.variants)[0])
433
- return (Object.keys(this.variants).length) ? true : false
432
+ console.log(this.variants)
433
+ return (Object.keys(this.variants).length && this.sku == Object.keys(this.variants)[0]) ? true : false
434
434
  }
435
435
  return this.sku.substring(2, 4) === "55";
436
436
  };
@@ -28,8 +28,6 @@ const ProductData = {
28
28
 
29
29
  getProductFromEquinox: async function (skus, locale, config) {
30
30
  const filter = `{"filters": [{"field": "index_key_skuId","operation": "IN", "value": "${skus.toString()}"}]}`;
31
- axios.defaults.withCredentials = true;
32
-
33
31
  const url = `${config.API_Base_URLs}/orchestrationservices/storefront/catalogs/search/`;
34
32
  const href = `${url}?filter=${encodeURI(filter)}`;
35
33
  const response = await axios.request({
@@ -40,7 +38,9 @@ const ProductData = {
40
38
  storeId: config.store_id
41
39
  },
42
40
  headers: this.getEquinoxRequestHeaders(),
43
- responseType: 'json'
41
+ responseType: 'json',
42
+ withCredentials: true
43
+
44
44
  });
45
45
 
46
46
  if (response.data.product) {