@nuskin/ns-product-lib 2.13.0-cx24-100723.8 → 2.13.0-cx24-100723.10

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.10](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-100723.9...v2.13.0-cx24-100723.10) (2023-10-11)
2
+
3
+
4
+ ### New
5
+
6
+ * Handle adding variants from bundle ([09cd868](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/09cd86831202974523dd6979d5cec22a29a7fb10))
7
+
8
+ # [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)
9
+
10
+
11
+ ### New
12
+
13
+ * Handle adding variants from bundle ([8aa1970](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/8aa19706f7d5da80a9bded7145bd8d2934bbe189))
14
+ * Handle adding variants from bundle ([146ddc3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/146ddc369e726e010b533e2cc5d1eea3727fdfd6))
15
+
1
16
  # [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)
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.8",
3
+ "version": "2.13.0-cx24-100723.10",
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,10 +15,11 @@ 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
- console.log('Checking sku ' + sku)
18
+ console.log('Checking sku ' + sku.identifier + ` ` + product.identifier)
19
19
  return sku.identifier === productWithVariant.variantSelected[product.identifier]
20
20
  })[0]
21
- } else {
21
+ }
22
+ if (!sku) {
22
23
  sku = product.sku.filter(sku => sku.default)[0];
23
24
  }
24
25
  } else {
@@ -27,7 +28,7 @@ function childSKUBundle(kits, product) {
27
28
 
28
29
 
29
30
  if (!sku) {
30
- throw Error('Unable to find the default SKU.');
31
+ throw Error('Unable to find the default SKU for product ' + product.identifier);
31
32
  }
32
33
 
33
34
  const kit = kits.filter(k => k.sku === product.identifier)[0];