@nuskin/ns-product-lib 2.7.0-cx24-3682.3 → 2.7.0-cx24-3682.5
Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# [2.7.0-cx24-3682.5](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.4...v2.7.0-cx24-3682.5) (2023-03-25)
|
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 ([588161d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/588161d54fa2e97f6bee2fe33523f3f1bdcb1ed2)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
|
7
|
+
|
8
|
+
# [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)
|
9
|
+
|
10
|
+
|
11
|
+
### New
|
12
|
+
|
13
|
+
* 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)
|
14
|
+
|
1
15
|
# [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
16
|
|
3
17
|
|
package/package.json
CHANGED
@@ -2,31 +2,30 @@
|
|
2
2
|
const httpStatus = { notFound: 404 };
|
3
3
|
|
4
4
|
/**
|
5
|
-
*
|
5
|
+
* productNotFound returns a model "ProductNotFound" when the status code 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
|
11
|
+
function productNotFound(error) {
|
12
12
|
const segments = 'catalogs/search';
|
13
|
-
const { config,
|
13
|
+
const { config, response } = error;
|
14
14
|
|
15
|
-
if (status === httpStatus.notFound && config.url.includes(segments)) {
|
15
|
+
if (response.status === httpStatus.notFound && config.url.includes(segments)) {
|
16
16
|
const params = new URLSearchParams(config.url);
|
17
17
|
const filterParam = Array.from(params.values())[0];
|
18
18
|
const sku = getSKU(filterParam);
|
19
19
|
|
20
|
-
if (sku
|
21
|
-
|
22
|
-
|
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 =
|
49
|
+
module.exports = productNotFound;
|
package/src/productData.js
CHANGED
@@ -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'
|