@nuskin/ns-product-lib 2.5.0-cx24-2179.2.9 → 2.5.0-cx24-3168.2

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.5.0-cx24-3168.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-3168.1...v2.5.0-cx24-3168.2) (2023-01-11)
2
+
3
+
4
+ ### Fix
5
+
6
+ * Equinox API called for non equinox market (CX24-3168) ([a399f64](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/a399f64f4a0717d3e61e9454fb3cc039da9c06bb))
7
+
8
+ # [2.5.0-cx24-3168.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2179.2.9...v2.5.0-cx24-3168.1) (2023-01-11)
9
+
10
+
11
+ ### Fix
12
+
13
+ * Equinox API called for non equinox market (CX24-3168) ([14a43f1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/14a43f14134644aeb0792a116c6955eccf5831af))
14
+
1
15
  # [2.5.0-cx24-2179.2.9](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2179.2.8...v2.5.0-cx24-2179.2.9) (2022-12-20)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.5.0-cx24-2179.2.9",
3
+ "version": "2.5.0-cx24-3168.2",
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,21 +15,25 @@ const ProductData = {
15
15
  */
16
16
  getProductData: async function (skus, locale, market, isEquinoxEnabled = false) {
17
17
  const localeMarket = `${locale}_${market}`;
18
-
18
+
19
19
  if (isEquinoxEnabled) {
20
- return await this.getProductFromEquinox(skus, localeMarket);
20
+ const config = (await getConfiguration({
21
+ configMapNames: ['Equinox_Markets'],
22
+ country: locale.split('_')[1],
23
+ environment: 'test',
24
+ clientId: '735b1eb810304bba966af0891ab54053'
25
+ })).Equinox_Markets;
26
+
27
+ if (config.store_id !== null) {
28
+ return await this.getProductFromEquinox(skus, localeMarket, config);
29
+ }
21
30
  }
22
31
 
23
32
  return await this.getProductFromLegacy(skus, localeMarket);
24
33
  },
25
34
 
26
- getProductFromEquinox: async function (skus, locale) {
27
- const config = (await getConfiguration({
28
- configMapNames: ['Equinox_Markets'],
29
- country: locale.split('_')[1],
30
- environment: 'test',
31
- clientId: '735b1eb810304bba966af0891ab54053'
32
- })).Equinox_Markets;
35
+ getProductFromEquinox: async function (skus, locale, config) {
36
+
33
37
  const filter = `{"filters": [{"field": "index_key_skuId","operation": "IN", "value": "${skus.toString()}"}]}`;
34
38
  axios.defaults.withCredentials = true;
35
39