thm-p3-configurator 0.0.329 → 0.0.331

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.
Files changed (24) hide show
  1. package/dist/src/shared/App.js +4 -3
  2. package/dist/src/shared/__api__/authenticatedProxyApi.js +107 -69
  3. package/dist/src/shared/__api__/mutations.js +70 -11
  4. package/dist/src/shared/__api__/orderApi.js +3 -21
  5. package/dist/src/shared/__api__/publicProxyApi.js +2 -1
  6. package/dist/src/shared/__api__/queries.js +26 -17
  7. package/dist/src/shared/__components__/LocationsSelector/index.js +2 -2
  8. package/dist/src/shared/__components__/internal/InternalCustomerDetailsForm.js +7 -3
  9. package/dist/src/shared/__containers__/AppointmentForm.js +7 -4
  10. package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +14 -4
  11. package/dist/src/shared/__containers__/internal/InternalBranchSelectorModal.js +2 -2
  12. package/dist/src/shared/__containers__/internal/InternalDiscountCodeSelector.js +1 -5
  13. package/dist/src/shared/__containers__/internal/InternalPriceCalculationSelector.js +2 -2
  14. package/dist/src/shared/__containers__/internal/InternalQuotationForm.js +12 -3
  15. package/dist/src/shared/__context__/AuthSessionContext.js +157 -0
  16. package/dist/src/shared/__helpers__/cookieManager.js +16 -76
  17. package/dist/src/shared/__helpers__/dossier.js +47 -16
  18. package/dist/src/shared/__helpers__/index.js +14 -1
  19. package/dist/src/shared/__hooks__/useAuthSession.js +7 -8
  20. package/dist/src/shared/__pages__/internal/InternalAppointmentPage.js +19 -8
  21. package/dist/src/shared/__pages__/internal/InternalLocationsPage.js +2 -2
  22. package/dist/src/shared/__pages__/internal/InternalQuotationPage.js +5 -4
  23. package/dist/src/shared/__services__/AuthRuntime.js +28 -0
  24. package/package.json +1 -1
@@ -22,6 +22,7 @@ var _TEST_ONLY_INTERNAL_ROUTES = _interopRequireDefault(require("./__pages__/int
22
22
  var _StyleWrapper = _interopRequireDefault(require("./__containers__/StyleWrapper"));
23
23
  var _InternalBranchSelectorModal = _interopRequireDefault(require("./__containers__/internal/InternalBranchSelectorModal"));
24
24
  var _ActiveMarkerContext = require("./__context__/ActiveMarkerContext");
25
+ var _AuthSessionContext = require("./__context__/AuthSessionContext");
25
26
  var _CountryContext = require("./__context__/CountryContext");
26
27
  var _FormulaContext = require("./__context__/FormulaContext");
27
28
  var _OrderSessionContext = require("./__context__/OrderSessionContext");
@@ -70,11 +71,11 @@ const App = () => {
70
71
  (0, _Experiments.default)();
71
72
  });
72
73
  return /*#__PURE__*/_react.default.createElement(_SentryWrapper.default, null, /*#__PURE__*/_react.default.createElement(_FormulaContext.FormulaController, {
73
- defaultFormula: _constants__.CONFIGURATOR_FORMULAS.THC
74
+ defaultFormula: _constants__.CONFIGURATOR_FORMULAS.THM
74
75
  }, /*#__PURE__*/_react.default.createElement(_CountryContext.CountryController, {
75
76
  defaultCountry: APP_CONFIG.country
76
- }, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
77
+ }, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_AuthSessionContext.AuthSessionProvider, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
77
78
  client: _queryClient.default
78
- }, /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_reactHotLoader.AppContainer, null, /*#__PURE__*/_react.default.createElement(_ActiveMarkerContext.ActiveMarkerProvider, null, /*#__PURE__*/_react.default.createElement(_StyleWrapper.default, null, !APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_Navbar.default, null), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalBranchSelectorModal.default, null), APP_CONFIG.nodeEnv === 'development' && APP_CONFIG.internal === true && /*#__PURE__*/_react.default.createElement(_TEST_ONLY_INTERNAL_ROUTES.default, null))))))))));
79
+ }, /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_reactHotLoader.AppContainer, null, /*#__PURE__*/_react.default.createElement(_ActiveMarkerContext.ActiveMarkerProvider, null, /*#__PURE__*/_react.default.createElement(_StyleWrapper.default, null, !APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_Navbar.default, null), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalBranchSelectorModal.default, null), /*#__PURE__*/_react.default.createElement(_pages__.default, null)))))))))));
79
80
  };
80
81
  var _default = exports.default = App;
@@ -1,85 +1,126 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.array.includes.js");
3
4
  require("core-js/modules/es.promise.js");
5
+ require("core-js/modules/es.promise.finally.js");
6
+ require("core-js/modules/es.string.includes.js");
4
7
  Object.defineProperty(exports, "__esModule", {
5
8
  value: true
6
9
  });
7
10
  exports.authenticatedProxyApi = void 0;
11
+ require("core-js/modules/es.array.includes.js");
8
12
  require("core-js/modules/es.promise.js");
13
+ require("core-js/modules/es.promise.finally.js");
14
+ require("core-js/modules/es.string.includes.js");
9
15
  var _axios = _interopRequireDefault(require("axios"));
10
- var _constants__ = require("../__constants__");
11
- var _cookieManager = require("../__helpers__/cookieManager");
12
- var _LocalStorageWorker = require("../__services__/LocalStorageWorker");
16
+ var _AuthRuntime = require("../__services__/AuthRuntime");
13
17
  function _interopRequireDefault(e) {
14
18
  return e && e.__esModule ? e : {
15
19
  default: e
16
20
  };
17
21
  }
18
- const authenticateClient = _axios.default.create({
19
- baseURL: APP_CONFIG.proxyUrl
22
+ const authenticatedClient = _axios.default.create({
23
+ baseURL: APP_CONFIG.proxyUrl,
24
+ withCredentials: true
20
25
  });
21
- const refreshClient = _axios.default.create({
22
- baseURL: APP_CONFIG.proxyUrl
26
+ const sessionClient = _axios.default.create({
27
+ baseURL: APP_CONFIG.proxyUrl,
28
+ withCredentials: true
23
29
  });
24
- refreshClient.interceptors.request.use(config => {
25
- const refreshToken = (0, _cookieManager.getRefreshToken)();
26
- config.headers.Authorization = "Bearer ".concat(refreshToken);
27
- return config;
28
- });
29
-
30
- /**
31
- * @description This interceptor:
32
- * - Appends the bearer token (For authentication)
33
- * - Appends the currently active branch Id (For authorization)
34
- */
35
- authenticateClient.interceptors.request.use(async config => {
36
- var _authSession$branch;
37
- const authSession = _LocalStorageWorker.lsw.getJson(_constants__.AUTH_SESSION_KEY);
38
- let accessToken = (0, _cookieManager.getAccessToken)();
39
- if (!accessToken && APP_CONFIG.internal) {
40
- try {
41
- const refreshResponse = await refreshClient('api/v1/auth', {
42
- method: 'PUT'
43
- });
44
- accessToken = refreshResponse.data.accessToken;
45
- (0, _cookieManager.setAccessToken)(accessToken);
46
- } catch (error) {
47
- console.log('error', error);
30
+ let refreshPromise = null;
31
+ const attachSessionHeaders = function attachSessionHeaders() {
32
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
33
+ config.headers = config.headers || {};
34
+ const branchId = _AuthRuntime.authRuntime.getActiveBranchId();
35
+ if (branchId) {
36
+ config.headers['active-branch-id'] = branchId;
37
+ }
38
+ const method = (config.method || 'get').toLowerCase();
39
+ if (!['get', 'head', 'options'].includes(method)) {
40
+ const csrf = _AuthRuntime.authRuntime.getCsrfToken();
41
+ if (csrf) {
42
+ config.headers['X-CSRF-Token'] = csrf;
48
43
  }
49
44
  }
50
- config.headers.Authorization = "Bearer ".concat(accessToken);
51
- config.headers['active-branch-id'] = authSession === null || authSession === void 0 || (_authSession$branch = authSession.branch) === null || _authSession$branch === void 0 ? void 0 : _authSession$branch.entityId;
52
45
  return config;
46
+ };
47
+ authenticatedClient.interceptors.request.use(config => attachSessionHeaders(config));
48
+ sessionClient.interceptors.request.use(config => {
49
+ const normalizedConfig = attachSessionHeaders(config);
50
+ if (normalizedConfig !== null && normalizedConfig !== void 0 && normalizedConfig.headers) {
51
+ delete normalizedConfig.headers['active-branch-id'];
52
+ }
53
+ return normalizedConfig;
54
+ });
55
+ authenticatedClient.interceptors.response.use(response => response, async error => {
56
+ var _error$response, _originalRequest$url;
57
+ const status = error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status;
58
+ const originalRequest = (error === null || error === void 0 ? void 0 : error.config) || {};
59
+ if (![401, 403].includes(status) || originalRequest._retry || (_originalRequest$url = originalRequest.url) !== null && _originalRequest$url !== void 0 && _originalRequest$url.includes('api/v1/auth')) {
60
+ return Promise.reject(error);
61
+ }
62
+ originalRequest._retry = true;
63
+ if (!refreshPromise) {
64
+ refreshPromise = sessionClient('api/v1/auth', {
65
+ method: 'PUT'
66
+ }).then(response => {
67
+ var _response$data;
68
+ _AuthRuntime.authRuntime.setCsrfToken((response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.csrfToken) || null);
69
+ return response;
70
+ }).finally(() => {
71
+ refreshPromise = null;
72
+ });
73
+ }
74
+ await refreshPromise;
75
+ return authenticatedClient(originalRequest);
53
76
  });
54
77
  const authenticatedProxyApi = exports.authenticatedProxyApi = {
55
- getArticleTypes: () => authenticateClient("api/v1/articles/types", {
78
+ getSession: () => sessionClient('api/v1/auth/session', {
79
+ method: 'GET'
80
+ }),
81
+ putSessionContext: function putSessionContext() {
82
+ let {
83
+ branchEntityId,
84
+ formula,
85
+ module
86
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
87
+ return authenticatedClient('api/v1/auth/context', {
88
+ method: 'PUT',
89
+ data: {
90
+ branchEntityId,
91
+ formula,
92
+ module
93
+ }
94
+ });
95
+ },
96
+ getArticleTypes: () => authenticatedClient("api/v1/articles/types", {
56
97
  method: 'GET'
57
98
  }),
58
- getCountries: () => authenticateClient("api/v1/countries", {
99
+ getCountries: () => authenticatedClient("api/v1/countries", {
59
100
  method: 'GET'
60
101
  }),
61
- putRefreshToken: () => refreshClient('api/v1/auth', {
102
+ putRefreshToken: () => sessionClient('api/v1/auth', {
62
103
  method: 'PUT'
63
104
  }),
64
- getArticleGroups: articleTypeId => authenticateClient("api/v1/articles/groups/".concat(articleTypeId), {
105
+ getArticleGroups: articleTypeId => authenticatedClient("api/v1/articles/groups/".concat(articleTypeId), {
65
106
  method: 'GET'
66
107
  }),
67
- getArticleSubGroups: (articleGroupId, formula) => authenticateClient("api/v1/articles/subgroups/".concat(articleGroupId, "?formula=").concat(formula), {
108
+ getArticleSubGroups: (articleGroupId, formula) => authenticatedClient("api/v1/articles/subgroups/".concat(articleGroupId, "?formula=").concat(formula), {
68
109
  method: 'GET'
69
110
  }),
70
- getArticles: filtersQueryString => authenticateClient("api/v1/articles?".concat(filtersQueryString), {
111
+ getArticles: filtersQueryString => authenticatedClient("api/v1/articles?".concat(filtersQueryString), {
71
112
  method: 'GET'
72
113
  }),
73
- getBrandsByArticleNumbers: articleNumbersString => authenticateClient("api/v1/articles/brands?".concat(articleNumbersString), {
114
+ getBrandsByArticleNumbers: articleNumbersString => authenticatedClient("api/v1/articles/brands?".concat(articleNumbersString), {
74
115
  method: 'GET'
75
116
  }),
76
- deleteLogout: () => authenticateClient("api/v1/auth", {
117
+ deleteLogout: () => sessionClient("api/v1/auth", {
77
118
  method: 'DELETE'
78
119
  }),
79
- getMyProfile: () => authenticateClient('api/v1/profile', {
120
+ getMyProfile: () => authenticatedClient('api/v1/profile', {
80
121
  method: 'GET'
81
122
  }),
82
- getBranchTypes: () => authenticateClient("api/v1/branch-types", {
123
+ getBranchTypes: () => authenticatedClient("api/v1/branch-types", {
83
124
  method: 'GET'
84
125
  }),
85
126
  getBranchesByType: _ref => {
@@ -91,29 +132,29 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
91
132
  isTmg = false,
92
133
  isTowCenterBranch = false
93
134
  } = _ref;
94
- return authenticateClient("api/v1/branches/by-type?searchTerm=".concat(searchTerm, "&formula=").concat(formula, "&ownershipType=").concat(ownershipType, "&organisationType=").concat(organisationType, "&isTmg=").concat(isTmg, "&isTowCenterBranch=").concat(isTowCenterBranch), {
135
+ return authenticatedClient("api/v1/branches/by-type?searchTerm=".concat(searchTerm, "&formula=").concat(formula, "&ownershipType=").concat(ownershipType, "&organisationType=").concat(organisationType, "&isTmg=").concat(isTmg, "&isTowCenterBranch=").concat(isTowCenterBranch), {
95
136
  method: 'GET'
96
137
  });
97
138
  },
98
- getMyBranchesByFormula: formula => authenticateClient("api/v1/profile/".concat(formula, "/branches"), {
139
+ getMyBranchesByFormula: formula => authenticatedClient("api/v1/profile/".concat(formula, "/branches"), {
99
140
  method: 'GET'
100
141
  }),
101
- getSingleOrderBranchTypes: branchTypesParamsString => authenticateClient("api/v1/branch-types?".concat(branchTypesParamsString), {
142
+ getSingleOrderBranchTypes: branchTypesParamsString => authenticatedClient("api/v1/branch-types?".concat(branchTypesParamsString), {
102
143
  method: 'GET'
103
144
  }),
104
- getSingleOrderBranches: branchesParamsString => authenticateClient("api/v1/branches?".concat(branchesParamsString), {
145
+ getSingleOrderBranches: branchesParamsString => authenticatedClient("api/v1/branches?".concat(branchesParamsString), {
105
146
  method: 'GET'
106
147
  }),
107
- getBranchById: id => authenticateClient("api/v1/branches/".concat(id), {
148
+ getBranchById: id => authenticatedClient("api/v1/branches/".concat(id), {
108
149
  method: 'GET'
109
150
  }),
110
- getQuotationById: id => authenticateClient("api/v1/quotations/".concat(id), {
151
+ getQuotationById: id => authenticatedClient("api/v1/quotations/".concat(id), {
111
152
  method: 'GET'
112
153
  }),
113
- getPlannedAppointmentById: id => authenticateClient("api/v1/appointments/".concat(id), {
154
+ getPlannedAppointmentById: id => authenticatedClient("api/v1/appointments/".concat(id), {
114
155
  method: 'GET'
115
156
  }),
116
- getAppointmentRequestById: id => authenticateClient("api/v1/appointment-requests/".concat(id), {
157
+ getAppointmentRequestById: id => authenticatedClient("api/v1/appointment-requests/".concat(id), {
117
158
  method: 'GET'
118
159
  }),
119
160
  getDossiers: _ref2 => {
@@ -124,7 +165,7 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
124
165
  branchId,
125
166
  formula
126
167
  } = _ref2;
127
- return authenticateClient("api/v1/dossiers?term=".concat(term, "&offset=").concat(offset, "&limit=").concat(limit).concat(branchId ? "&branchId=".concat(branchId) : '').concat(formula ? "&formula=".concat(formula) : ''), {
168
+ return authenticatedClient("api/v1/dossiers?term=".concat(term, "&offset=").concat(offset, "&limit=").concat(limit).concat(branchId ? "&branchId=".concat(branchId) : '').concat(formula ? "&formula=".concat(formula) : ''), {
128
169
  method: 'GET'
129
170
  });
130
171
  },
@@ -133,40 +174,37 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
133
174
  id,
134
175
  payload
135
176
  } = _ref3;
136
- return authenticateClient("api/v1/dossiers/".concat(id), {
177
+ return authenticatedClient("api/v1/dossiers/".concat(id), {
137
178
  method: 'PUT',
138
179
  data: payload
139
180
  });
140
181
  },
141
- postAppointmentRequest: appointmentRequestPayload => authenticateClient("api/v1/appointment-requests", {
182
+ postAppointmentRequest: appointmentRequestPayload => authenticatedClient("api/v1/appointment-requests", {
142
183
  method: 'POST',
143
184
  data: appointmentRequestPayload,
144
185
  headers: {
145
186
  'Content-Type': 'application/json'
146
187
  }
147
188
  }),
148
- postQuotation: quotationPayload => authenticateClient("api/v1/quotations", {
189
+ postQuotation: quotationPayload => authenticatedClient("api/v1/quotations", {
149
190
  method: 'POST',
150
191
  data: quotationPayload,
151
192
  headers: {
152
193
  'Content-Type': 'application/json'
153
194
  }
154
195
  }),
155
- postSingleOrder: singleOrderPayload => authenticateClient("api/v1/single-orders", {
196
+ postSingleOrder: singleOrderPayload => authenticatedClient("api/v1/single-orders", {
156
197
  method: 'POST',
157
198
  data: singleOrderPayload,
158
199
  headers: {
159
200
  'Content-Type': 'application/json'
160
201
  }
161
202
  }),
162
- postShopifyOrder: shopifyOrderPayload => authenticateClient("api/v1/single-orders/shopify", {
203
+ postShopifyOrder: shopifyOrderPayload => authenticatedClient("api/v1/single-orders/shopify", {
163
204
  method: 'POST',
164
- data: shopifyOrderPayload,
165
- headers: {
166
- 'Content-Type': 'application/json'
167
- }
205
+ data: shopifyOrderPayload
168
206
  }),
169
- postAppointment: appointmentPayload => authenticateClient("api/v1/appointments", {
207
+ postAppointment: appointmentPayload => authenticatedClient("api/v1/appointments", {
170
208
  method: 'POST',
171
209
  data: appointmentPayload,
172
210
  headers: {
@@ -178,7 +216,7 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
178
216
  payload,
179
217
  id
180
218
  } = _ref4;
181
- return authenticateClient("api/v1/quotations/".concat(id), {
219
+ return authenticatedClient("api/v1/quotations/".concat(id), {
182
220
  method: 'PUT',
183
221
  data: payload,
184
222
  headers: {
@@ -191,7 +229,7 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
191
229
  payload,
192
230
  id
193
231
  } = _ref5;
194
- return authenticateClient("api/v1/appointments/".concat(id), {
232
+ return authenticatedClient("api/v1/appointments/".concat(id), {
195
233
  method: 'PUT',
196
234
  data: payload,
197
235
  headers: {
@@ -204,7 +242,7 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
204
242
  payload,
205
243
  id
206
244
  } = _ref6;
207
- return authenticateClient("api/v1/appointment-requests/".concat(id, "?action=order"), {
245
+ return authenticatedClient("api/v1/appointment-requests/".concat(id, "?action=order"), {
208
246
  method: 'PUT',
209
247
  data: payload,
210
248
  headers: {
@@ -218,19 +256,19 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
218
256
  limit,
219
257
  offset
220
258
  } = _ref7;
221
- return authenticateClient("api/v1/discounts?limit=".concat(limit, "&offset=").concat(offset, "&formulaCode=").concat(formulaCode), {
259
+ return authenticatedClient("api/v1/discounts?limit=".concat(limit, "&offset=").concat(offset, "&formulaCode=").concat(formulaCode), {
222
260
  method: 'GET',
223
261
  headers: {
224
262
  'Content-Type': 'application/json'
225
263
  }
226
264
  });
227
265
  },
228
- getPartBrands: () => authenticateClient("api/v1/configurator/part-brands", {
266
+ getPartBrands: () => authenticatedClient("api/v1/configurator/part-brands", {
229
267
  method: 'GET'
230
268
  }),
231
269
  getOrder: orderParameters => {
232
270
  const basePath = APP_CONFIG.internal ? 'api/v1' : 'api/public/v1';
233
- return authenticateClient("".concat(basePath, "/configurator/order?").concat(orderParameters), {
271
+ return authenticatedClient("".concat(basePath, "/configurator/order?").concat(orderParameters), {
234
272
  method: 'GET'
235
273
  });
236
274
  },
@@ -239,7 +277,7 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
239
277
  return null;
240
278
  }
241
279
  const basePath = APP_CONFIG.internal ? 'api/v1' : 'api/public/v1';
242
- return authenticateClient("".concat(basePath, "/configurator/prices?").concat(partsQueryString), {
280
+ return authenticatedClient("".concat(basePath, "/configurator/prices?").concat(partsQueryString), {
243
281
  method: 'GET'
244
282
  });
245
283
  }
@@ -166,7 +166,8 @@ const useCreateAppointmentRequestMutation = () => {
166
166
  isCreateAppointmentRequestError: createAppointmentRequestMutation.isError,
167
167
  isCreateAppointmentRequestSuccess: createAppointmentRequestMutation.isSuccess,
168
168
  resetAppointmentRequestCreation: createAppointmentRequestMutation.reset,
169
- createAppointmentRequest: createAppointmentRequestMutation.mutate
169
+ createAppointmentRequest: createAppointmentRequestMutation.mutate,
170
+ createAppointmentRequestError: createAppointmentRequestMutation.error
170
171
  };
171
172
  };
172
173
 
@@ -472,7 +473,8 @@ const useCreatePrivateAppointmentMutation = () => {
472
473
  isCreatePlannedAppointmentSuccess: createPlannedAppointmentMutation.isSuccess,
473
474
  resetPlannedAppointmentCreation: createPlannedAppointmentMutation.reset,
474
475
  createPlannedAppointment: createPlannedAppointmentMutation.mutateAsync,
475
- data: createPlannedAppointmentMutation.data
476
+ data: createPlannedAppointmentMutation.data,
477
+ createPlannedAppointmentError: createPlannedAppointmentMutation.error
476
478
  };
477
479
  };
478
480
 
@@ -559,7 +561,8 @@ const useCreatePrivateAppointmentRequestMutation = () => {
559
561
  isCreateAppointmentRequestSuccess: createAppointmentRequestMutation.isSuccess,
560
562
  resetAppointmentRequestCreation: createAppointmentRequestMutation.reset,
561
563
  createAppointmentRequest: createAppointmentRequestMutation.mutateAsync,
562
- data: createAppointmentRequestMutation.data
564
+ data: createAppointmentRequestMutation.data,
565
+ createPrivateAppointmentRequestError: createAppointmentRequestMutation.error
563
566
  };
564
567
  };
565
568
 
@@ -586,7 +589,16 @@ const useUpdatePrivateAppointmentRequestByIdMutation = id => {
586
589
  discount,
587
590
  priceCalculationDate,
588
591
  customerAgreed,
589
- montageRate
592
+ montageRate,
593
+ leasemaatschappijEntityId,
594
+ leasemaatschappijBedrijfsnaam,
595
+ leasemaatschappijContactpersoonNaam,
596
+ leasemaatschappijContactTelefoonnummer,
597
+ leasemaatschappijContactEMailadres,
598
+ zakelijkContactPersoonNaam,
599
+ zakelijkContactTelefoonnummer,
600
+ zakeiljkContactFactuuradres,
601
+ zakelijkContactEMailadres
590
602
  } = _ref11;
591
603
  const _ref12 = customer || {},
592
604
  {
@@ -620,7 +632,16 @@ const useUpdatePrivateAppointmentRequestByIdMutation = id => {
620
632
  branchId,
621
633
  priceCalculationDate,
622
634
  customerAgreed,
623
- montageRate: apiMontageRate
635
+ montageRate: apiMontageRate,
636
+ leasemaatschappijEntityId,
637
+ leasemaatschappijBedrijfsnaam,
638
+ leasemaatschappijContactpersoonNaam,
639
+ leasemaatschappijContactTelefoonnummer,
640
+ leasemaatschappijContactEMailadres,
641
+ zakelijkContactPersoonNaam,
642
+ zakelijkContactTelefoonnummer,
643
+ zakeiljkContactFactuuradres,
644
+ zakelijkContactEMailadres
624
645
  }
625
646
  });
626
647
  });
@@ -630,7 +651,8 @@ const useUpdatePrivateAppointmentRequestByIdMutation = id => {
630
651
  isUpdateAppointmentRequestSuccess: updateAppointmentRequestByIdMutation.isSuccess,
631
652
  resetAppointmentRequestUpdate: updateAppointmentRequestByIdMutation.reset,
632
653
  updateAppointmentRequest: updateAppointmentRequestByIdMutation.mutateAsync,
633
- data: updateAppointmentRequestByIdMutation.data
654
+ data: updateAppointmentRequestByIdMutation.data,
655
+ updateAppointmentRequestError: updateAppointmentRequestByIdMutation.error
634
656
  };
635
657
  };
636
658
 
@@ -656,7 +678,16 @@ const useUpdatePrivateQuotationByIdMutation = id => {
656
678
  discount,
657
679
  extraPrice,
658
680
  priceCalculationDate,
659
- montageRate
681
+ montageRate,
682
+ leasemaatschappijEntityId,
683
+ leasemaatschappijBedrijfsnaam,
684
+ leasemaatschappijContactpersoonNaam,
685
+ leasemaatschappijContactTelefoonnummer,
686
+ leasemaatschappijContactEMailadres,
687
+ zakelijkContactPersoonNaam,
688
+ zakelijkContactTelefoonnummer,
689
+ zakeiljkContactFactuuradres,
690
+ zakelijkContactEMailadres
660
691
  } = _ref13;
661
692
  const _ref14 = customer || {},
662
693
  {
@@ -689,7 +720,16 @@ const useUpdatePrivateQuotationByIdMutation = id => {
689
720
  customer: restCustomer,
690
721
  branchId,
691
722
  priceCalculationDate,
692
- montageRate: apiMontageRate
723
+ montageRate: apiMontageRate,
724
+ leasemaatschappijEntityId,
725
+ leasemaatschappijBedrijfsnaam,
726
+ leasemaatschappijContactpersoonNaam,
727
+ leasemaatschappijContactTelefoonnummer,
728
+ leasemaatschappijContactEMailadres,
729
+ zakelijkContactPersoonNaam,
730
+ zakelijkContactTelefoonnummer,
731
+ zakeiljkContactFactuuradres,
732
+ zakelijkContactEMailadres
693
733
  }
694
734
  });
695
735
  });
@@ -728,7 +768,16 @@ const useUpdatePrivateAppointmentByIdMutation = id => {
728
768
  priceCalculationDate,
729
769
  customerAgreed,
730
770
  invoicePaymentByLeaseCompany,
731
- montageRate
771
+ montageRate,
772
+ leasemaatschappijEntityId,
773
+ leasemaatschappijBedrijfsnaam,
774
+ leasemaatschappijContactpersoonNaam,
775
+ leasemaatschappijContactTelefoonnummer,
776
+ leasemaatschappijContactEMailadres,
777
+ zakelijkContactPersoonNaam,
778
+ zakelijkContactTelefoonnummer,
779
+ zakeiljkContactFactuuradres,
780
+ zakelijkContactEMailadres
732
781
  } = _ref15;
733
782
  const _ref16 = customer || {},
734
783
  {
@@ -765,7 +814,16 @@ const useUpdatePrivateAppointmentByIdMutation = id => {
765
814
  branchId,
766
815
  priceCalculationDate,
767
816
  customerAgreed,
768
- montageRate: apiMontageRate
817
+ montageRate: apiMontageRate,
818
+ leasemaatschappijEntityId,
819
+ leasemaatschappijBedrijfsnaam,
820
+ leasemaatschappijContactpersoonNaam,
821
+ leasemaatschappijContactTelefoonnummer,
822
+ leasemaatschappijContactEMailadres,
823
+ zakelijkContactPersoonNaam,
824
+ zakelijkContactTelefoonnummer,
825
+ zakeiljkContactFactuuradres,
826
+ zakelijkContactEMailadres
769
827
  }
770
828
  });
771
829
  });
@@ -775,7 +833,8 @@ const useUpdatePrivateAppointmentByIdMutation = id => {
775
833
  isUpdateAppointmentSuccess: updateAppointmentByIdMutation.isSuccess,
776
834
  resetAppointmentUpdate: updateAppointmentByIdMutation.reset,
777
835
  updateAppointment: updateAppointmentByIdMutation.mutateAsync,
778
- data: updateAppointmentByIdMutation.data
836
+ data: updateAppointmentByIdMutation.data,
837
+ updateAppointmentError: updateAppointmentByIdMutation.error
779
838
  };
780
839
  };
781
840
  exports.useUpdatePrivateAppointmentByIdMutation = useUpdatePrivateAppointmentByIdMutation;
@@ -5,35 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.orderApi = void 0;
7
7
  var _axios = _interopRequireDefault(require("axios"));
8
- var _index = require("../__constants__/index.js");
9
- var _LocalStorageWorker = require("../__services__/LocalStorageWorker.js");
10
8
  function _interopRequireDefault(e) {
11
9
  return e && e.__esModule ? e : {
12
10
  default: e
13
11
  };
14
12
  }
15
13
  const publicOrderClient = _axios.default.create({
16
- baseURL: APP_CONFIG.proxyUrl
17
- });
18
- const orderClient = _axios.default.create({
19
- baseURL: APP_CONFIG.apiUrl
20
- });
21
-
22
- /**
23
- * @description This interceptor:
24
- * - Does nothing if it's the external configurator
25
- * - Otherwise: Appends the bearer token, to authenticate to the private hyper Order API
26
- */
27
- orderClient.interceptors.request.use(config => {
28
- if (!APP_CONFIG.internal) {
29
- return config;
30
- }
31
- const authSession = _LocalStorageWorker.lsw.getJson(_index.AUTH_SESSION_KEY);
32
- config.headers.Authorization = "Bearer ".concat(authSession === null || authSession === void 0 ? void 0 : authSession.accessToken);
33
- return config;
14
+ baseURL: APP_CONFIG.proxyUrl,
15
+ withCredentials: true
34
16
  });
35
17
  const orderApi = exports.orderApi = {
36
- getArticles: filters => orderClient("api/public/articles?".concat(filters)),
18
+ getArticles: filters => publicOrderClient("api/public/articles?".concat(filters)),
37
19
  getBrands: function getBrands() {
38
20
  let formula = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'THC';
39
21
  return publicOrderClient("api/public/v1/configurator/makes?formula=".concat(formula));
@@ -11,7 +11,8 @@ function _interopRequireDefault(e) {
11
11
  };
12
12
  }
13
13
  const client = _axios.default.create({
14
- baseURL: APP_CONFIG.proxyUrl
14
+ baseURL: APP_CONFIG.proxyUrl,
15
+ withCredentials: true
15
16
  });
16
17
  const publicProxyApi = exports.publicProxyApi = {
17
18
  postQuotation: quotationBody => client("api/public/v1/quotations", {