@nuskin/ns-product-lib 2.3.0-cx24-2186.1 → 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,9 +1,9 @@
1
- # [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)
2
2
 
3
3
 
4
4
  ### New
5
5
 
6
- * 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)
7
7
 
8
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)
9
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.1",
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": {
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,6 @@ const ProductData = {
92
92
 
93
93
  eqProductMapper: function (productDataResponse) {
94
94
  let prod = [];
95
-
96
- //sku[0] is equal to base sku
97
95
  let count = 0;
98
96
 
99
97
  let prodArr = productDataResponse.map((data) => {
@@ -210,17 +208,17 @@ const ProductData = {
210
208
  },
211
209
  "restrictedMarkets": [],
212
210
  "addOns": [],
213
- inventoryLabel: data.sku[count].inventory || ""
214
- };
211
+ "inventoryLabel": data.sku[count].inventory || ""
215
212
 
216
- return new Product(prod);
217
- });
213
+ };
214
+ let newProduct = new Product(prod);
215
+ return newProduct
216
+ })
218
217
 
219
218
  let data = {
220
219
  products: prodArr,
221
220
  count: productDataResponse.length
222
221
  };
223
-
224
222
  return {
225
223
  data: {
226
224
  "status": 200,