thm-p3-configurator 0.0.69 → 0.0.70
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,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.promise.js");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.orderApi = void 0;
|
|
8
|
-
require("core-js/modules/es.promise.js");
|
|
9
7
|
var _axios = _interopRequireDefault(require("axios"));
|
|
10
8
|
var _index = require("../__constants__/index.js");
|
|
11
9
|
var _LocalStorageWorker = require("../__services__/LocalStorageWorker.js");
|
|
@@ -31,25 +29,9 @@ orderClient.interceptors.request.use(config => {
|
|
|
31
29
|
config.headers.Authorization = "Bearer ".concat(authSession === null || authSession === void 0 ? void 0 : authSession.accessToken);
|
|
32
30
|
return config;
|
|
33
31
|
});
|
|
34
|
-
|
|
35
|
-
// Add response interceptor to handle 4xx errors
|
|
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
|
-
});
|
|
47
32
|
const orderApi = exports.orderApi = {
|
|
48
|
-
getOrder: orderParameters =>
|
|
49
|
-
|
|
50
|
-
return orderClient("api".concat(APP_CONFIG.internal ? '' : '/public', "/order?").concat(orderParameters) // Remove the `/public` param if the configurator is internal,
|
|
51
|
-
);
|
|
52
|
-
},
|
|
33
|
+
getOrder: orderParameters => orderClient("api".concat(APP_CONFIG.internal ? '' : '/public', "/order?").concat(orderParameters) // Remove the `/public` param if the configurator is internal,
|
|
34
|
+
),
|
|
53
35
|
getArticlePrices: partsQueryString => orderClient("api".concat(APP_CONFIG.internal ? '' : '/public', "/prices?").concat(partsQueryString)),
|
|
54
36
|
getArticles: filters => orderClient("api/public/articles?".concat(filters)),
|
|
55
37
|
getBrands: () => orderClient('api/public/makes'),
|
|
@@ -297,9 +297,13 @@ const useSingleOrderArticles = exports.useSingleOrderArticles = function useSing
|
|
|
297
297
|
*/
|
|
298
298
|
const useSingleOrderCart = () => {
|
|
299
299
|
const [{
|
|
300
|
-
singleOrderCart
|
|
300
|
+
singleOrderCart,
|
|
301
|
+
singleOrderFormulaCode
|
|
301
302
|
}] = (0, _OrderSessionContext.useOrderSession)();
|
|
302
|
-
|
|
303
|
+
let formula = (0, _FormulaContext.useFormula)();
|
|
304
|
+
if (singleOrderFormulaCode) {
|
|
305
|
+
formula = singleOrderFormulaCode;
|
|
306
|
+
}
|
|
303
307
|
let cartOrderQuery = new URLSearchParams((0, _helpers__.removeNullishProps)({
|
|
304
308
|
formula,
|
|
305
309
|
isSingle: true,
|
|
@@ -62,7 +62,7 @@ const VehicleData = _ref => {
|
|
|
62
62
|
isDefaultExpanded: true,
|
|
63
63
|
body: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ' ', /*#__PURE__*/_react.default.createElement("div", {
|
|
64
64
|
className: (0, _helpers__.withStyle)('col-auto col-md-12 text-center')
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
65
|
+
}, !isFilter && /*#__PURE__*/_react.default.createElement("img", {
|
|
66
66
|
className: (0, _helpers__.withStyle)('vehicle-data__image img-fluid rounded-1 mx-0 mb-1'),
|
|
67
67
|
src: (0, _image.getImageFromHyper)({
|
|
68
68
|
imageId: vehicleLogo
|