@nuskin/ns-product-lib 2.3.0-cx24-2186.2 → 2.3.0-cx24-2186.2.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,16 +1,9 @@
1
- # [2.3.0-cx24-2186.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.3.0-cx24-2186.1...v2.3.0-cx24-2186.2) (2022-10-17)
2
-
3
-
4
- ### Fix
5
-
6
- * added stable ns-util version (#CX24-2186) ([cb868f1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/cb868f14be7420ea5d70d542a77cf470cdfec40c)), closes [#CX24-2186](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2186)
7
-
8
- # [2.3.0-cx24-2186.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.2.0...v2.3.0-cx24-2186.1) (2022-10-13)
1
+ # [2.3.0-cx24-2186.2.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.2.0...v2.3.0-cx24-2186.2.1) (2022-10-18)
9
2
 
10
3
 
11
4
  ### New
12
5
 
13
- * added inventory label in the mapping (#CX24-2186) ([a24fc39](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/a24fc39915e3d7e525949a2de8be04727c5226fd)), closes [#CX24-2186](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2186)
6
+ * added support for inventory label (#CX24-2186) ([469e309](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/469e3090e98cf2ff7fb199fbc4c2d85e42e04819)), closes [#CX24-2186](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2186)
14
7
 
15
8
  # [2.2.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.1.0...v2.2.0) (2022-10-13)
16
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.3.0-cx24-2186.2",
3
+ "version": "2.3.0-cx24-2186.2.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": {
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@nuskin/ns-common-lib": "1.4.5",
33
- "@nuskin/ns-util": "3.105.0-CX24.1",
33
+ "@nuskin/ns-util": "3.107.0",
34
34
  "axios": "0.27.2",
35
35
  "qs": "6.11.0"
36
36
  },
package/src/product.js CHANGED
@@ -72,11 +72,6 @@ const Product = function(productData) {
72
72
  // agelocme stuff
73
73
  this.agelocme = null; // object containing agelocme information (like code, label, name)
74
74
 
75
- //equinox API inventory label
76
- //@example "IN STOCK"
77
- //@string inventoryLabel
78
- this.inventoryLabel = "";
79
-
80
75
  this.setMarketAttributes = function(productStatus) {
81
76
  if (productStatus.marketAttributes) {
82
77
  this.marketAttributes = productStatus.marketAttributes;
@@ -631,7 +626,6 @@ const Product = function(productData) {
631
626
  this.marketAttributes = productData.marketAttributes;
632
627
  this.addOns = productData.addOns || [];
633
628
  this.restrictedMarkets = productData.restrictedMarkets || [];
634
- this.inventoryLabel = productData.inventoryLabel || "";
635
629
 
636
630
  if (data.priceType) {
637
631
  this.addPricing(data.priceType, data.price);
@@ -92,8 +92,9 @@ const ProductData = {
92
92
 
93
93
  eqProductMapper: function (productDataResponse) {
94
94
  let prod = [];
95
+ let count = 0;
95
96
 
96
- let prodArr = productDataResponse.map((data, count) => {
97
+ let prodArr = productDataResponse.map((data) => {
97
98
  let imageURL = data.sku[count].properties.imageURL;
98
99
  const regex = /\d+.\d+/
99
100
  let thumbnailImage = ''
@@ -207,17 +208,17 @@ const ProductData = {
207
208
  },
208
209
  "restrictedMarkets": [],
209
210
  "addOns": [],
210
- inventoryLabel: data.sku[count].inventory || ""
211
- };
211
+ "inventoryLabel": data.sku[count].inventory || ""
212
212
 
213
- return new Product(prod);
214
- });
213
+ };
214
+ let newProduct = new Product(prod);
215
+ return newProduct
216
+ })
215
217
 
216
218
  let data = {
217
219
  products: prodArr,
218
220
  count: productDataResponse.length
219
221
  };
220
-
221
222
  return {
222
223
  data: {
223
224
  "status": 200,