@nuskin/ns-product-lib 2.5.0-cx24-2179.2.17 → 2.5.0-cx24-refactor.1

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.5.0-cx24-refactor.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2179.2.17...v2.5.0-cx24-refactor.1) (2023-01-26)
2
+
3
+
4
+ ### Update
5
+
6
+ * refactoring getConfiguration ([76c54aa](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/76c54aa7b3a9a81c56e701314e6515edac451fe2))
7
+
1
8
  # [2.5.0-cx24-2179.2.17](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2179.2.16...v2.5.0-cx24-2179.2.17) (2023-01-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.5.0-cx24-2179.2.17",
3
+ "version": "2.5.0-cx24-refactor.1",
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": {
@@ -6,6 +6,8 @@ const contentstack = require('./contentstack/contentstack');
6
6
  const Product = require("./product");
7
7
  const CustomerTypes = require('./models/customerTypes');
8
8
  const ProductStatus = require("./models/productStatus");
9
+ const { getEnvironmentFromUrl } = require('@nuskin/ns-common-lib');
10
+
9
11
  /** @type {*} */
10
12
  const ProductData = {
11
13
  /**
@@ -16,12 +18,16 @@ const ProductData = {
16
18
  */
17
19
  getProductData: async function (skus, locale, market, isEquinoxEnabled = false) {
18
20
  const localeMarket = `${locale}_${market}`;
19
-
21
+ let env = 'test';
22
+ if (typeof window !== 'undefined') {
23
+ env = getEnvironmentFromUrl(window.location.host);
24
+ }
25
+ console.log(`ENV is ${env}`)
20
26
  if (isEquinoxEnabled) {
21
27
  let config = (await getConfiguration({
22
28
  configMapNames: ['Equinox_Markets'],
23
29
  country: market,
24
- environment: 'test',
30
+ environment: env,
25
31
  clientId: '735b1eb810304bba966af0891ab54053'
26
32
  }));
27
33