@nuskin/ns-product-lib 2.11.0-cx24-5092.10 → 2.11.0-cx24-5092.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # [2.11.0-cx24-5092.12](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.11...v2.11.0-cx24-5092.12) (2023-09-13)
2
+
3
+
4
+ ### New
5
+
6
+ * Moving from AEM to CS for EQ markets ([4973d82](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/4973d82f1ce7bd7746f357ff357a65e880ad22d0))
7
+ * Moving from AEM to CS for EQ markets ([1a2ed1b](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/1a2ed1bbea62a7e3d1b076aae1d0df9f528afb72))
8
+
9
+ # [2.11.0-cx24-5092.11](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.10...v2.11.0-cx24-5092.11) (2023-09-13)
10
+
11
+
12
+ ### New
13
+
14
+ * Moving from AEM to CS for EQ markets ([538bdc1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/538bdc1d777091afa844985cffccbc693cd04f23))
15
+
1
16
  # [2.11.0-cx24-5092.10](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.9...v2.11.0-cx24-5092.10) (2023-09-13)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.11.0-cx24-5092.10",
3
+ "version": "2.11.0-cx24-5092.12",
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": {
@@ -35,22 +35,29 @@ const ProductGraphQL = {
35
35
  operationName: "getProduct",
36
36
  useContentSource: "CS"
37
37
  }
38
- const response = await axios.request({
39
- method: 'post',
40
- url: url,
41
- data: payload,
42
- responseType: 'json'
43
- });
44
-
45
- if (!response.data || !response.data.productById.error.errors[0]) {
38
+ try {
39
+ const response = await axios.request({
40
+ method: 'post',
41
+ url: url,
42
+ data: payload,
43
+ responseType: 'json'
44
+ });
46
45
  return {
47
- status: 400,
48
- messages: [response.data.productById.error.errors[0]],
46
+ data: {
47
+ "status": 200,
48
+ "messages": [],
49
+ "data": this.mapResponseToProduct(response.data.data.productById)
50
+ }
51
+ }
52
+ } catch (e) {
53
+ return {
54
+ status: 404,
55
+ messages: ["Error getting product details in Contentstack"],
49
56
  data: { count: 0, products: [] }
50
57
  };
51
58
  }
52
59
 
53
- return this.mapResponseToProduct(response.data.productById);
60
+
54
61
 
55
62
  },
56
63