@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.
@@ -751,9 +751,9 @@ var returnDataAtom = /*#__PURE__*/atom([]);
751
751
  function useReturnData() {
752
752
  return useAtom(returnDataAtom);
753
753
  }
754
- var apiCalling = /*#__PURE__*/atom(false);
755
- function useApiCalling() {
756
- return useAtom(apiCalling);
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 18:
2427
- _context.prev = 18;
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 21:
2436
- _context.prev = 21;
2437
- return _context.finish(21);
2438
- case 23:
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, 18, 21, 23]]);
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 _useApiCalling = useApiCalling(),
2466
- setCallApi = _useApiCalling[1]; //single detail
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 = 4;
2501
+ _context.next = 3;
2500
2502
  return updateOrder([payload]);
2501
- case 4:
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 _useApiCalling = useApiCalling(),
8477
- apiCalling = _useApiCalling[0];
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
- if (apiCalling) {
8538
- orderUpdate(true);
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) {