thm-p3-configurator 0.0.79 → 0.0.80

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.
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.promise.js");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.orderApi = void 0;
8
+ require("core-js/modules/es.promise.js");
7
9
  var _axios = _interopRequireDefault(require("axios"));
8
10
  var _index = require("../__constants__/index.js");
9
11
  var _LocalStorageWorker = require("../__services__/LocalStorageWorker.js");
@@ -29,6 +31,19 @@ orderClient.interceptors.request.use(config => {
29
31
  config.headers.Authorization = "Bearer ".concat(authSession === null || authSession === void 0 ? void 0 : authSession.accessToken);
30
32
  return config;
31
33
  });
34
+
35
+ // Add response interceptor to log 4xx errors
36
+ orderClient.interceptors.response.use(response => response, error => {
37
+ if (error.response && error.response.status >= 400 && error.response.status < 500) {
38
+ console.log('4xx Error:', {
39
+ status: error.response.status,
40
+ url: error.config.url,
41
+ method: error.config.method,
42
+ data: error.response.data
43
+ });
44
+ }
45
+ return Promise.reject(error);
46
+ });
32
47
  const orderApi = exports.orderApi = {
33
48
  getOrder: orderParameters => orderClient("api".concat(APP_CONFIG.internal ? '' : '/public', "/order?").concat(orderParameters) // Remove the `/public` param if the configurator is internal,
34
49
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.79",
3
+ "version": "0.0.80",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",