thm-p3-configurator 0.0.68 → 0.0.69

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");
@@ -31,10 +33,23 @@ orderClient.interceptors.request.use(config => {
31
33
  });
32
34
 
33
35
  // Add response interceptor to handle 4xx errors
34
-
36
+ orderClient.interceptors.response.use(response => response, error => {
37
+ if (error.response && error.response.status >= 400 && error.response.status < 500) {
38
+ console.error('API Error:', {
39
+ status: error.response.status,
40
+ statusText: error.response.statusText,
41
+ data: error.response.data,
42
+ url: error.config.url
43
+ });
44
+ }
45
+ return Promise.reject(error);
46
+ });
35
47
  const orderApi = exports.orderApi = {
36
- getOrder: orderParameters => orderClient("api".concat(APP_CONFIG.internal ? '' : '/public', "/order?").concat(orderParameters) // Remove the `/public` param if the configurator is internal,
37
- ),
48
+ getOrder: orderParameters => {
49
+ console.log(orderParameters);
50
+ return orderClient("api".concat(APP_CONFIG.internal ? '' : '/public', "/order?").concat(orderParameters) // Remove the `/public` param if the configurator is internal,
51
+ );
52
+ },
38
53
  getArticlePrices: partsQueryString => orderClient("api".concat(APP_CONFIG.internal ? '' : '/public', "/prices?").concat(partsQueryString)),
39
54
  getArticles: filters => orderClient("api/public/articles?".concat(filters)),
40
55
  getBrands: () => orderClient('api/public/makes'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",