@nuskin/ns-product-lib 2.13.0-cx24-100723.7 → 2.13.0-cx24-100723.9

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # [2.13.0-cx24-100723.9](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-100723.8...v2.13.0-cx24-100723.9) (2023-10-11)
2
+
3
+
4
+ ### New
5
+
6
+ * Handle adding variants from bundle ([8aa1970](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/8aa19706f7d5da80a9bded7145bd8d2934bbe189))
7
+ * Handle adding variants from bundle ([146ddc3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/146ddc369e726e010b533e2cc5d1eea3727fdfd6))
8
+
9
+ # [2.13.0-cx24-100723.8](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-100723.7...v2.13.0-cx24-100723.8) (2023-10-10)
10
+
11
+
12
+ ### New
13
+
14
+ * Handle adding variants from bundle ([9188040](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9188040aa88ccbccd28e28a471c786b9395ba123))
15
+
1
16
  # [2.13.0-cx24-100723.7](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-100723.6...v2.13.0-cx24-100723.7) (2023-10-10)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.13.0-cx24-100723.7",
3
+ "version": "2.13.0-cx24-100723.9",
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": {
@@ -15,7 +15,8 @@ function childSKUBundle(kits, product) {
15
15
  const productWithVariant = personalOffer.products.filter((sku) => sku.variantSelected !== null)[0]
16
16
  if (productWithVariant !== null) {
17
17
  sku = product.sku.filter((sku) => {
18
- return sku.identifier == productWithVariant.variantSelected[product.identifier]
18
+ console.log('Checking sku ' + sku.identifier + ` ` + product.identifier)
19
+ return sku.identifier === productWithVariant.variantSelected[product.identifier]
19
20
  })[0]
20
21
  } else {
21
22
  sku = product.sku.filter(sku => sku.default)[0];
@@ -26,7 +27,7 @@ function childSKUBundle(kits, product) {
26
27
 
27
28
 
28
29
  if (!sku) {
29
- throw Error('Unable to find the default SKU.');
30
+ throw Error('Unable to find the default SKU for product ' + product.identifier);
30
31
  }
31
32
 
32
33
  const kit = kits.filter(k => k.sku === product.identifier)[0];