@nuskin/ns-product-lib 2.8.1-cx24-4061.1 → 2.9.0-cx24-4091.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
- ## [2.8.1-cx24-4061.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.0...v2.8.1-cx24-4061.1) (2023-05-09)
1
+ # [2.9.0-cx24-4091.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.0...v2.9.0-cx24-4091.1) (2023-05-15)
2
2
 
3
3
 
4
- ### Fix
4
+ ### Update
5
5
 
6
- * Multiple variants add to cart not adding correct sku ([1c20e6e](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/1c20e6e394ed9bf680be2cd7a2f500d83288b87a))
6
+ * Bump configuration sdk ([49e9d9f](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/49e9d9f2e658a6f17a7d5df13ccb7d05f5aa9508))
7
7
 
8
8
  # [2.8.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.1...v2.8.0) (2023-05-02)
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.8.1-cx24-4061.1",
3
+ "version": "2.9.0-cx24-4091.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": {
@@ -31,7 +31,7 @@
31
31
  "prettier": "1.19.1"
32
32
  },
33
33
  "dependencies": {
34
- "@nuskin/configuration-sdk": "2.2.3",
34
+ "@nuskin/configuration-sdk": "2.2.5",
35
35
  "@nuskin/ns-common-lib": "1.4.5",
36
36
  "@nuskin/ns-util": "4.3.2",
37
37
  "axios": "0.27.2",
@@ -364,9 +364,8 @@ const ProductData = {
364
364
  let variants = {};
365
365
  let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
366
366
  let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
367
- let thumbnailImage = imageURL ? imageURL + '?width=40' : '';
368
- let productTitle = productData.properties.name;
369
- let productSku = product.identifier
367
+ let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
368
+
370
369
 
371
370
  if (productData.sku && productData.sku.length > 1) {
372
371
  // exclude base product from variants
@@ -374,9 +373,6 @@ const ProductData = {
374
373
  variants[variant.identifier] = this.eqProductVariantMapper(variant);
375
374
  return variant;
376
375
  });
377
- const productArr = productData.sku.filter(p => p.default === true)
378
- productTitle = productArr[0].properties.name;
379
- productSku = productArr[0].identifier
380
376
  }
381
377
 
382
378
  const {
@@ -398,9 +394,9 @@ const ProductData = {
398
394
  product.availableQuantity = mapAvailableQuantity(product);
399
395
  product = {
400
396
  ...product,
401
- "sku": productSku,
397
+ "sku": product.identifier,
402
398
  "globalProductID": productData.identifier,
403
- "title": productTitle,
399
+ "title": productData.properties.name,
404
400
  "country": product.properties.market,
405
401
  "language": "en",
406
402
  "shortDescr": productData.properties.description,
@@ -517,7 +513,7 @@ const ProductData = {
517
513
  };
518
514
  },
519
515
 
520
- mapEquinoxSKUExists: function (exists) {
516
+ mapEquinoxSKUExists: function(exists) {
521
517
  // this could be avoided if only we are using response mapper
522
518
  // for equinox products that exists.
523
519
  // @todo: clean-up