thm-p3-configurator 0.0.185 → 0.0.186
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.
|
@@ -12,6 +12,9 @@ function _interopRequireDefault(e) {
|
|
|
12
12
|
default: e
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
+
const publicOrderClient = _axios.default.create({
|
|
16
|
+
baseURL: APP_CONFIG.proxyUrl
|
|
17
|
+
});
|
|
15
18
|
const orderClient = _axios.default.create({
|
|
16
19
|
baseURL: APP_CONFIG.apiUrl
|
|
17
20
|
});
|
|
@@ -31,13 +34,13 @@ orderClient.interceptors.request.use(config => {
|
|
|
31
34
|
});
|
|
32
35
|
const orderApi = exports.orderApi = {
|
|
33
36
|
getArticles: filters => orderClient("api/public/articles?".concat(filters)),
|
|
34
|
-
getBrands: () =>
|
|
35
|
-
getBuildYears: brand =>
|
|
37
|
+
getBrands: () => publicOrderClient('api/public/v1/configurator/makes'),
|
|
38
|
+
getBuildYears: brand => publicOrderClient("api/public/v1/configurator/makes/".concat(brand, "/years")),
|
|
36
39
|
getModels: _ref => {
|
|
37
40
|
let {
|
|
38
41
|
brand,
|
|
39
42
|
year
|
|
40
43
|
} = _ref;
|
|
41
|
-
return
|
|
44
|
+
return publicOrderClient("api/public/v1/configurator/makes/".concat(brand, "/models").concat(year ? "?year=".concat(year) : ''));
|
|
42
45
|
}
|
|
43
46
|
};
|
|
@@ -86,7 +86,7 @@ const useBrandsQuery = () => {
|
|
|
86
86
|
const brandsQuery = (0, _reactQuery.useQuery)(['brands'], {
|
|
87
87
|
queryFn: () => _orderApi.orderApi.getBrands().then(res => {
|
|
88
88
|
var _res$data;
|
|
89
|
-
return (0, _helpers__.parseArrayToInputOptions)((_res$data = res
|
|
89
|
+
return (0, _helpers__.parseArrayToInputOptions)((_res$data = res === null || res === void 0 ? void 0 : res.data) !== null && _res$data !== void 0 ? _res$data : []);
|
|
90
90
|
})
|
|
91
91
|
});
|
|
92
92
|
return {
|
|
@@ -108,7 +108,7 @@ const useBuildYearsQuery = _ref => {
|
|
|
108
108
|
enabled: !!(brand !== null && brand !== void 0 && brand.length),
|
|
109
109
|
queryFn: () => _orderApi.orderApi.getBuildYears(brand).then(res => {
|
|
110
110
|
var _res$data2;
|
|
111
|
-
return (0, _helpers__.parseArrayToInputOptions)((_res$data2 = res
|
|
111
|
+
return (0, _helpers__.parseArrayToInputOptions)((_res$data2 = res === null || res === void 0 ? void 0 : res.data) !== null && _res$data2 !== void 0 ? _res$data2 : []);
|
|
112
112
|
})
|
|
113
113
|
});
|
|
114
114
|
return {
|
|
@@ -219,7 +219,7 @@ const useModelsQuery = _ref2 => {
|
|
|
219
219
|
year
|
|
220
220
|
}).then(res => {
|
|
221
221
|
var _res$data3;
|
|
222
|
-
return (0, _helpers__.parseArrayToInputOptions)((_res$data3 = res
|
|
222
|
+
return (0, _helpers__.parseArrayToInputOptions)((_res$data3 = res === null || res === void 0 ? void 0 : res.data) !== null && _res$data3 !== void 0 ? _res$data3 : []);
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
});
|