thm-p3-configurator 0.0.81 → 0.0.83
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/dist/src/shared/__api__/orderApi.js +0 -15
- package/dist/src/shared/__containers__/VehicleData.js +5 -1
- package/dist/src/shared/__containers__/internal/InternalBranchSelectorModal.js +6 -11
- package/dist/src/shared/__containers__/internal/InternalSingleOrderProductOverview.js +0 -3
- package/dist/src/shared/__context__/OrderSessionContext.js +1 -0
- package/package.json +1 -1
|
@@ -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,19 +29,6 @@ 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 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
|
-
});
|
|
47
32
|
const orderApi = exports.orderApi = {
|
|
48
33
|
getOrder: orderParameters => orderClient("api".concat(APP_CONFIG.internal ? '' : '/public', "/order?").concat(orderParameters) // Remove the `/public` param if the configurator is internal,
|
|
49
34
|
),
|
|
@@ -36,9 +36,13 @@ const VehicleData = _ref => {
|
|
|
36
36
|
durationAnswer,
|
|
37
37
|
discountCode,
|
|
38
38
|
priceCalculationDate,
|
|
39
|
+
singleOrderFormulaCode,
|
|
39
40
|
existingDossierId
|
|
40
41
|
}] = (0, _OrderSessionContext.useOrderSession)();
|
|
41
|
-
|
|
42
|
+
let formula = (0, _FormulaContext.useFormula)();
|
|
43
|
+
if (isFilter && singleOrderFormulaCode) {
|
|
44
|
+
formula = singleOrderFormulaCode;
|
|
45
|
+
}
|
|
42
46
|
const {
|
|
43
47
|
vehicleDetails,
|
|
44
48
|
vehicleLogo
|
|
@@ -204,17 +204,12 @@ const SingleOrderModalContent = _ref3 => {
|
|
|
204
204
|
} = _ref5;
|
|
205
205
|
setSelectedBranchId(value);
|
|
206
206
|
setLocalBranchId(value);
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
} else {
|
|
216
|
-
console.log('no formula code found');
|
|
217
|
-
}
|
|
207
|
+
dispatch({
|
|
208
|
+
type: _OrderSessionContext.orderSessionActions.SET_SINGLE_ORDER_FORMULA_CODE,
|
|
209
|
+
payload: {
|
|
210
|
+
formulaCode: branchIdWithFormulaCode.get(value)
|
|
211
|
+
}
|
|
212
|
+
});
|
|
218
213
|
}
|
|
219
214
|
}));
|
|
220
215
|
};
|
|
@@ -98,12 +98,9 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
98
98
|
executionAnswer2
|
|
99
99
|
}] = (0, _OrderSessionContext.useOrderSession)();
|
|
100
100
|
let formula = (0, _FormulaContext.useFormula)();
|
|
101
|
-
console.log('singleOrderFormulaCode', singleOrderFormulaCode);
|
|
102
101
|
if (singleOrderFormulaCode) {
|
|
103
102
|
formula = singleOrderFormulaCode;
|
|
104
|
-
console.log('hello world');
|
|
105
103
|
}
|
|
106
|
-
console.log('current formula', formula);
|
|
107
104
|
const mergedFilters = _objectSpread(_objectSpread({}, filters), {}, {
|
|
108
105
|
licensePlate,
|
|
109
106
|
model,
|
|
@@ -381,6 +381,7 @@ const orderSessionReducer = (state, action) => {
|
|
|
381
381
|
selectedBranch: (state === null || state === void 0 ? void 0 : state.selectedBranch) || (INITIAL_ORDER_SESSION_STATE === null || INITIAL_ORDER_SESSION_STATE === void 0 ? void 0 : INITIAL_ORDER_SESSION_STATE.selectedBranch),
|
|
382
382
|
discountCode: (state === null || state === void 0 ? void 0 : state.discountCode) || (INITIAL_ORDER_SESSION_STATE === null || INITIAL_ORDER_SESSION_STATE === void 0 ? void 0 : INITIAL_ORDER_SESSION_STATE.discountCode),
|
|
383
383
|
singleOrderCart: (state === null || state === void 0 ? void 0 : state.singleOrderCart) || (INITIAL_ORDER_SESSION_STATE === null || INITIAL_ORDER_SESSION_STATE === void 0 ? void 0 : INITIAL_ORDER_SESSION_STATE.singleOrderCart),
|
|
384
|
+
singleOrderFormulaCode: (state === null || state === void 0 ? void 0 : state.singleOrderFormulaCode) || (INITIAL_ORDER_SESSION_STATE === null || INITIAL_ORDER_SESSION_STATE === void 0 ? void 0 : INITIAL_ORDER_SESSION_STATE.singleOrderFormulaCode),
|
|
384
385
|
isTouched: true
|
|
385
386
|
});
|
|
386
387
|
}
|