@nuskin/ns-product-lib 2.13.0-cx24-5107.11 → 2.13.0-cx24-5107.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,10 @@
1
+ # [2.13.0-cx24-5107.12](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-5107.11...v2.13.0-cx24-5107.12) (2023-10-10)
2
+
3
+
4
+ ### Fix
5
+
6
+ * circular json structure ([7b24b0c](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/7b24b0c32cb0a5458a3481a3b9f7ecd5003cae9a))
7
+
1
8
  # [2.13.0-cx24-5107.11](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-5107.10...v2.13.0-cx24-5107.11) (2023-10-10)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.13.0-cx24-5107.11",
3
+ "version": "2.13.0-cx24-5107.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": {
@@ -161,7 +161,9 @@ function mapProduct(product, market, locale, config) {
161
161
  "equinoxProductId": product.id,
162
162
  "inventory": defaultVariant.status.isBackordered ? 'BACKORDER' : 'IN STOCK',
163
163
  "properties": {
164
- ...defaultVariant
164
+ isBackOrdered : defaultVariant.status.isBackordered,
165
+ inventoryStatus: defaultVariant.status.isBackordered ? 'BACKORDER' : 'IN STOCK',
166
+ productStatus: mapProductStatus(defaultVariant.status.status)
165
167
  }
166
168
 
167
169
  }
@@ -265,9 +267,11 @@ function mapVariants(product) {
265
267
  "searchScore": 0,
266
268
  "isExclusive": variant.isExclusive || false,
267
269
  "equinoxProductId": product.id,
268
- "inventory": variant.status.isBackordered ? 'BACKORDER' : 'IN STOCK',
270
+ "inventory": variant.status.isBackordered ? 'BACKORDER' : 'IN STOCK', //@todo deprecate this since we can set properties.isBackOrdered
269
271
  "properties": {
270
- ...product
272
+ isBackOrdered : variant.status.isBackordered,
273
+ inventoryStatus: variant.status.isBackordered ? 'BACKORDER' : 'IN STOCK',
274
+ productStatus: mapProductStatus(variant.status.status)
271
275
  }
272
276
  }
273
277
  });