@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 +7 -0
- package/package.json +1 -1
- package/src/productData.js +8 -2
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
package/src/productData.js
CHANGED
@@ -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:
|
30
|
+
environment: env,
|
25
31
|
clientId: '735b1eb810304bba966af0891ab54053'
|
26
32
|
}));
|
27
33
|
|