@nuskin/ns-product-lib 2.7.1-cx24-3879.2 → 2.7.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [2.7.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0...v2.7.1) (2023-04-15)
2
+
3
+
4
+ ### Fix
5
+
6
+ * updating text in unit testing ([65393d6](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/65393d6492b0696a24daa56f79b768cc38e1c7ae))
7
+
8
+ # [2.8.0-cx24-3705.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.0-cx24-3705.1...v2.8.0-cx24-3705.2) (2023-04-14)
9
+
10
+
11
+ ### Update
12
+
13
+ * setting correct title if multiple variants ([583e74d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/583e74d41acc7213cd86a48df9076a453da8bb93))
14
+
15
+ # [2.8.0-cx24-3705.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0...v2.8.0-cx24-3705.1) (2023-04-14)
16
+
17
+
18
+ ### Update
19
+
20
+ * setting correct title if multiple variants ([9574804](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9574804094f65261ff45c9658ba4e4d4baf0bdf2))
21
+
1
22
  ## [2.7.1-cx24-3879.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.1-cx24-3879.1...v2.7.1-cx24-3879.2) (2023-04-13)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.7.1-cx24-3879.2",
3
+ "version": "2.7.1",
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": {
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@nuskin/configuration-sdk": "2.2.3",
35
35
  "@nuskin/ns-common-lib": "1.4.5",
36
- "@nuskin/ns-util": "4.2.7",
36
+ "@nuskin/ns-util": "4.3.2",
37
37
  "axios": "0.27.2",
38
38
  "qs": "6.11.0"
39
39
  },
@@ -364,7 +364,7 @@ const ProductData = {
364
364
  let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
365
365
  let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
366
366
  let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
367
-
367
+ let productTitle = productData.properties.name
368
368
 
369
369
  if (productData.sku && productData.sku.length > 1) {
370
370
  // exclude base product from variants
@@ -372,6 +372,10 @@ const ProductData = {
372
372
  variants[variant.identifier] = this.eqProductVariantMapper(variant);
373
373
  return variant;
374
374
  });
375
+ const productArr = productData.sku.filter(p => p.default === true)
376
+ productTitle = productArr[0].properties.name;
377
+ product = productArr[0]
378
+
375
379
  }
376
380
 
377
381
  const {
@@ -393,7 +397,7 @@ const ProductData = {
393
397
  ...product,
394
398
  "sku": product.identifier,
395
399
  "globalProductID": productData.identifier,
396
- "title": productData.properties.name,
400
+ "title": productTitle,
397
401
  "country": product.properties.market,
398
402
  "language": "en",
399
403
  "shortDescr": productData.properties.description,
@@ -510,7 +514,7 @@ const ProductData = {
510
514
  };
511
515
  },
512
516
 
513
- mapEquinoxSKUExists: function(exists) {
517
+ mapEquinoxSKUExists: function (exists) {
514
518
  // this could be avoided if only we are using response mapper
515
519
  // for equinox products that exists.
516
520
  // @todo: clean-up