@bjsdistribution/dms-client-return 0.0.54 → 0.0.55
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/components/order-view/store.d.ts +2 -1
- package/dist/dms-client-return.cjs.development.js +22 -22
- package/dist/dms-client-return.cjs.development.js.map +1 -1
- package/dist/dms-client-return.cjs.production.min.js +1 -1
- package/dist/dms-client-return.cjs.production.min.js.map +1 -1
- package/dist/dms-client-return.esm.js +22 -22
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/order-view/hooks/useUpdateOrder.ts +3 -0
- package/src/components/order-view/index.tsx +4 -7
- package/src/components/order-view/modalsPopup/DeleteProduct.tsx +2 -2
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +3 -5
- package/src/components/order-view/store.ts +13 -7
|
@@ -751,9 +751,9 @@ var returnDataAtom = /*#__PURE__*/atom([]);
|
|
|
751
751
|
function useReturnData() {
|
|
752
752
|
return useAtom(returnDataAtom);
|
|
753
753
|
}
|
|
754
|
-
var
|
|
755
|
-
function
|
|
756
|
-
return useAtom(
|
|
754
|
+
var apiUpdateCalling = /*#__PURE__*/atom(false);
|
|
755
|
+
function useUpdateApiCall() {
|
|
756
|
+
return useAtom(apiUpdateCalling);
|
|
757
757
|
}
|
|
758
758
|
var liveRecalling = /*#__PURE__*/atom(false);
|
|
759
759
|
//re api call of live status
|
|
@@ -2380,6 +2380,8 @@ var Container$s = /*#__PURE__*/styled.div(_templateObject3$c || (_templateObject
|
|
|
2380
2380
|
function useUpdateOrder() {
|
|
2381
2381
|
var controller;
|
|
2382
2382
|
var ssoToken = getCookie('id_token');
|
|
2383
|
+
var _useUpdateApiCall = useUpdateApiCall(),
|
|
2384
|
+
setCallApi = _useUpdateApiCall[1]; //single detail
|
|
2383
2385
|
var update = /*#__PURE__*/function () {
|
|
2384
2386
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
|
2385
2387
|
var endpoint, signal, requestOptions, response, json;
|
|
@@ -2422,9 +2424,10 @@ function useUpdateOrder() {
|
|
|
2422
2424
|
message: 'Success',
|
|
2423
2425
|
description: 'Order has been updated.'
|
|
2424
2426
|
});
|
|
2427
|
+
setCallApi(true);
|
|
2425
2428
|
return _context.abrupt("return", json);
|
|
2426
|
-
case
|
|
2427
|
-
_context.prev =
|
|
2429
|
+
case 19:
|
|
2430
|
+
_context.prev = 19;
|
|
2428
2431
|
_context.t0 = _context["catch"](4);
|
|
2429
2432
|
// setLoading(false);
|
|
2430
2433
|
// console.log(err, 'error');
|
|
@@ -2432,14 +2435,14 @@ function useUpdateOrder() {
|
|
|
2432
2435
|
message: 'Error',
|
|
2433
2436
|
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
2434
2437
|
});
|
|
2435
|
-
case
|
|
2436
|
-
_context.prev =
|
|
2437
|
-
return _context.finish(
|
|
2438
|
-
case
|
|
2438
|
+
case 22:
|
|
2439
|
+
_context.prev = 22;
|
|
2440
|
+
return _context.finish(22);
|
|
2441
|
+
case 24:
|
|
2439
2442
|
case "end":
|
|
2440
2443
|
return _context.stop();
|
|
2441
2444
|
}
|
|
2442
|
-
}, _callee, null, [[4,
|
|
2445
|
+
}, _callee, null, [[4, 19, 22, 24]]);
|
|
2443
2446
|
}));
|
|
2444
2447
|
return function update(_x) {
|
|
2445
2448
|
return _ref.apply(this, arguments);
|
|
@@ -2462,8 +2465,8 @@ function OrderDetailsFooter() {
|
|
|
2462
2465
|
var _useAtom = useAtom(errorAtom),
|
|
2463
2466
|
errorState = _useAtom[0];
|
|
2464
2467
|
// const [, setLogsCallAPi] = useLogsCallAPi();
|
|
2465
|
-
var
|
|
2466
|
-
setCallApi =
|
|
2468
|
+
var _useUpdateApiCall = useUpdateApiCall(),
|
|
2469
|
+
setCallApi = _useUpdateApiCall[1]; //single detail
|
|
2467
2470
|
// const [, setNoteLoadingStore] = UseNotesLoading();
|
|
2468
2471
|
var errorFound = function errorFound() {
|
|
2469
2472
|
var isError = errorState.w3wError.length > 0 || errorState.emailError.length > 0 || errorState.homeContactError.length > 0 || errorState.workCOntanctError.length > 0 || errorState.mobileError.length > 0 || errorState.postCodeError.length > 0;
|
|
@@ -2494,12 +2497,12 @@ function OrderDetailsFooter() {
|
|
|
2494
2497
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2495
2498
|
while (1) switch (_context.prev = _context.next) {
|
|
2496
2499
|
case 0:
|
|
2497
|
-
setCallApi(true);
|
|
2498
2500
|
payload = compareOrderDetailsStates(prevOrderDetails, orderDetails);
|
|
2499
|
-
_context.next =
|
|
2501
|
+
_context.next = 3;
|
|
2500
2502
|
return updateOrder([payload]);
|
|
2501
|
-
case
|
|
2503
|
+
case 3:
|
|
2502
2504
|
response = _context.sent;
|
|
2505
|
+
setCallApi(false);
|
|
2503
2506
|
// setLogsCallAPi(prev => !prev);
|
|
2504
2507
|
if (response && (response == null || (_response$data = response.data) == null ? void 0 : _response$data.length) > 0) {
|
|
2505
2508
|
setOrderDetails(response == null ? void 0 : response.data[0]);
|
|
@@ -8473,8 +8476,8 @@ function OrderView() {
|
|
|
8473
8476
|
var paths = splitPath(location.pathname);
|
|
8474
8477
|
var _useLocationOptions = useLocationOptions(),
|
|
8475
8478
|
setLocationOptions = _useLocationOptions[1];
|
|
8476
|
-
var
|
|
8477
|
-
apiCalling =
|
|
8479
|
+
var _useUpdateApiCall = useUpdateApiCall(),
|
|
8480
|
+
apiCalling = _useUpdateApiCall[0];
|
|
8478
8481
|
var _useOrderProductsReso = useOrderProductsResources(),
|
|
8479
8482
|
orderResources = _useOrderProductsReso[0],
|
|
8480
8483
|
setOrderResources = _useOrderProductsReso[1];
|
|
@@ -8534,11 +8537,8 @@ function OrderView() {
|
|
|
8534
8537
|
}
|
|
8535
8538
|
}, [orderId, liveRecalling]);
|
|
8536
8539
|
useEffect(function () {
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
} else {
|
|
8540
|
-
orderUpdate(false);
|
|
8541
|
-
}
|
|
8540
|
+
orderUpdate(true);
|
|
8541
|
+
apiCalling ? orderUpdate(true) : orderUpdate(false);
|
|
8542
8542
|
}, [apiCalling]);
|
|
8543
8543
|
useEffect(function () {
|
|
8544
8544
|
if (paths.length > 1) {
|