@nuskin/ns-product-lib 2.7.0-cx24-3682.3 → 2.7.0-cx24-3682.4

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.7.0-cx24-3682.4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.3...v2.7.0-cx24-3682.4) (2023-03-24)
2
+
3
+
4
+ ### New
5
+
6
+ * MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([f55854a](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/f55854ad4abb17dbd373fe5e36a38deb2bb8fc53)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
7
+
1
8
  # [2.7.0-cx24-3682.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.2...v2.7.0-cx24-3682.3) (2023-03-24)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.7.0-cx24-3682.3",
3
+ "version": "2.7.0-cx24-3682.4",
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": {
@@ -2,13 +2,13 @@
2
2
  const httpStatus = { notFound: 404 };
3
3
 
4
4
  /**
5
- * productNotFoundInterceptor is called when an equinox product is not found
5
+ * productNotFound is called when an equinox product is not found
6
6
  * Note: Do not polute this file. Create a new file for new interceptor.
7
7
  *
8
8
  * @param {import('axios').AxiosError} error
9
9
  * @returns {import('../').EquinoxResponse}
10
10
  */
11
- function productNotFoundInterceptor(error) {
11
+ function productNotFound(error) {
12
12
  const segments = 'catalogs/search';
13
13
  const { config, status } = error;
14
14
 
@@ -17,16 +17,15 @@ function productNotFoundInterceptor(error) {
17
17
  const filterParam = Array.from(params.values())[0];
18
18
  const sku = getSKU(filterParam);
19
19
 
20
- if (sku === null) {
21
- console.error('Unable to find SKU', error);
22
- return Promise.reject(error);
23
- }
24
-
25
- return {
26
- product: {
27
- sku
20
+ if (sku !== null) {
21
+ return {
22
+ product: {
23
+ sku
24
+ }
28
25
  }
29
26
  }
27
+
28
+ console.error('Unable to detect SKU from the given parameter', filterParam);
30
29
  }
31
30
 
32
31
  return Promise.reject(error);
@@ -47,4 +46,4 @@ function getSKU(param) {
47
46
  return result[0];
48
47
  }
49
48
 
50
- module.exports = productNotFoundInterceptor;
49
+ module.exports = productNotFound;
@@ -6,7 +6,7 @@ const Product = require("./product");
6
6
  const CustomerTypes = require('./models/customerTypes');
7
7
  const ProductStatus = require("./models/productStatus");
8
8
  const { mapAvailableQuantity, mapChildSKU } = require('./equinox-helpers');
9
- const productNotFoundInterceptor = require('./equinox-helpers/interceptors');
9
+ const { productNotFoundInterceptor } = require('./equinox-helpers/interceptors');
10
10
 
11
11
  const productTypes = {
12
12
  kit: 'kit'