@nuskin/ns-product-lib 2.11.0-cx24-5092.2 → 2.11.0-cx24-5092.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,17 @@
1
+ # [2.11.0-cx24-5092.4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.3...v2.11.0-cx24-5092.4) (2023-09-08)
2
+
3
+
4
+ ### New
5
+
6
+ * Moving from AEM to CS for EQ markets ([af5acd8](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/af5acd8dca1c73004b6ee634faf90d6e47f974fd))
7
+
8
+ # [2.11.0-cx24-5092.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.2...v2.11.0-cx24-5092.3) (2023-09-08)
9
+
10
+
11
+ ### New
12
+
13
+ * Moving from AEM to CS for EQ markets ([1c61841](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/1c6184105b06c7a04846f78d2e4d939c3ff67e93))
14
+
1
15
  # [2.11.0-cx24-5092.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.1...v2.11.0-cx24-5092.2) (2023-09-08)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.11.0-cx24-5092.2",
3
+ "version": "2.11.0-cx24-5092.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": {
@@ -27,11 +27,10 @@ const ProductData = {
27
27
 
28
28
 
29
29
  const config = (await getConfiguration(['Equinox_Markets'])).Equinox_Markets;
30
- skus.forEach((sku) => {
31
- const graphQLResponse = ProductGraphQL.getProductFromGraphQL(sku)
32
- console.log(graphQLResponse)
33
- console.log(isEquinoxEnabled)
34
- })
30
+ const graphQLResponse = ProductGraphQL.getProductFromGraphQL(skus)
31
+ console.log(graphQLResponse)
32
+ console.log(isEquinoxEnabled)
33
+
35
34
 
36
35
 
37
36
  if (config.active) {
@@ -6,35 +6,38 @@ const getProductGql = require('./graphQl/query')
6
6
 
7
7
 
8
8
  const ProductGraphQL = {
9
- getProductFromGraphQL: async function (sku) {
9
+ getProductFromGraphQL: async function (skus) {
10
10
 
11
- let data = JSON.stringify({
12
- query: getProductGql,
13
- variables: { "market": "us", "language": "en", "id": sku, "useContentSource": null, "quantity": 1, "okta": null }
11
+ skus.forEach(sku => {
12
+ let data = JSON.stringify({
13
+ query: getProductGql,
14
+ variables: { "market": "us", "language": "en", "id": sku, "useContentSource": null, "quantity": 1, "okta": null }
15
+ });
16
+
17
+ let axiosGqlConfig = {
18
+ method: 'post',
19
+ url: 'https://product.api.test.nuskin.com/graphql',
20
+ headers: {
21
+ 'authority': 'product.api.test.nuskin.com',
22
+ 'accept': '*/*',
23
+ 'accept-language': 'en-US,en;q=0.9',
24
+ 'content-type': 'application/json',
25
+ 'origin': 'https://mysite.test.mynuskin.com',
26
+ 'referer': 'https://mysite.test.mynuskin.com/'
27
+
28
+ },
29
+ data: data
30
+ };
31
+
32
+ axios.request(axiosGqlConfig)
33
+ .then((response) => {
34
+ return response.data
35
+ })
36
+ .catch((error) => {
37
+ console.log(error);
38
+ });
14
39
  });
15
40
 
16
- let axiosGqlConfig = {
17
- method: 'post',
18
- url: 'https://product.api.test.nuskin.com/graphql',
19
- headers: {
20
- 'authority': 'product.api.test.nuskin.com',
21
- 'accept': '*/*',
22
- 'accept-language': 'en-US,en;q=0.9',
23
- 'content-type': 'application/json',
24
- 'origin': 'https://mysite.test.mynuskin.com',
25
- 'referer': 'https://mysite.test.mynuskin.com/'
26
-
27
- },
28
- data: data
29
- };
30
-
31
- axios.request(axiosGqlConfig)
32
- .then((response) => {
33
- return response.data
34
- })
35
- .catch((error) => {
36
- console.log(error);
37
- });
38
41
 
39
42
  }
40
43