@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.
@@ -110,8 +110,9 @@ export declare function useRouteId(): [number | undefined, (args_0: number | ((p
110
110
  export declare function useGsitOrderId(): [number | undefined, (args_0: number | ((prev: number | undefined) => number | undefined) | undefined) => void];
111
111
  export declare function useOrderProductId(): [number | undefined, (args_0: number | ((prev: number | undefined) => number | undefined) | undefined) => void];
112
112
  export declare function useReturnData(): [any[], (args_0: any[] | ((prev: any[]) => any[])) => void];
113
- export declare function useApiCalling(): [boolean, (args_0: boolean | ((prev: boolean) => boolean)) => void];
113
+ export declare function useUpdateApiCall(): [boolean, (args_0: boolean | ((prev: boolean) => boolean)) => void];
114
114
  export declare function useLiveRecalling(): [boolean, (args_0: boolean | ((prev: boolean) => boolean)) => void];
115
+ export declare function useDeleteRecall(): [boolean, (args_0: boolean | ((prev: boolean) => boolean)) => void];
115
116
  export declare const selectedTabKeyAtom: import("jotai/esm/").PrimitiveAtom<string> & {
116
117
  init: string;
117
118
  };
@@ -759,9 +759,9 @@ var returnDataAtom = /*#__PURE__*/jotai.atom([]);
759
759
  function useReturnData() {
760
760
  return jotai.useAtom(returnDataAtom);
761
761
  }
762
- var apiCalling = /*#__PURE__*/jotai.atom(false);
763
- function useApiCalling() {
764
- return jotai.useAtom(apiCalling);
762
+ var apiUpdateCalling = /*#__PURE__*/jotai.atom(false);
763
+ function useUpdateApiCall() {
764
+ return jotai.useAtom(apiUpdateCalling);
765
765
  }
766
766
  var liveRecalling = /*#__PURE__*/jotai.atom(false);
767
767
  //re api call of live status
@@ -2388,6 +2388,8 @@ var Container$s = /*#__PURE__*/styled__default.div(_templateObject3$c || (_templ
2388
2388
  function useUpdateOrder() {
2389
2389
  var controller;
2390
2390
  var ssoToken = getCookie('id_token');
2391
+ var _useUpdateApiCall = useUpdateApiCall(),
2392
+ setCallApi = _useUpdateApiCall[1]; //single detail
2391
2393
  var update = /*#__PURE__*/function () {
2392
2394
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
2393
2395
  var endpoint, signal, requestOptions, response, json;
@@ -2430,9 +2432,10 @@ function useUpdateOrder() {
2430
2432
  message: 'Success',
2431
2433
  description: 'Order has been updated.'
2432
2434
  });
2435
+ setCallApi(true);
2433
2436
  return _context.abrupt("return", json);
2434
- case 18:
2435
- _context.prev = 18;
2437
+ case 19:
2438
+ _context.prev = 19;
2436
2439
  _context.t0 = _context["catch"](4);
2437
2440
  // setLoading(false);
2438
2441
  // console.log(err, 'error');
@@ -2440,14 +2443,14 @@ function useUpdateOrder() {
2440
2443
  message: 'Error',
2441
2444
  description: "" + _context.t0 || 'An error has occurred. Please try again later.'
2442
2445
  });
2443
- case 21:
2444
- _context.prev = 21;
2445
- return _context.finish(21);
2446
- case 23:
2446
+ case 22:
2447
+ _context.prev = 22;
2448
+ return _context.finish(22);
2449
+ case 24:
2447
2450
  case "end":
2448
2451
  return _context.stop();
2449
2452
  }
2450
- }, _callee, null, [[4, 18, 21, 23]]);
2453
+ }, _callee, null, [[4, 19, 22, 24]]);
2451
2454
  }));
2452
2455
  return function update(_x) {
2453
2456
  return _ref.apply(this, arguments);
@@ -2470,8 +2473,8 @@ function OrderDetailsFooter() {
2470
2473
  var _useAtom = jotai.useAtom(errorAtom),
2471
2474
  errorState = _useAtom[0];
2472
2475
  // const [, setLogsCallAPi] = useLogsCallAPi();
2473
- var _useApiCalling = useApiCalling(),
2474
- setCallApi = _useApiCalling[1]; //single detail
2476
+ var _useUpdateApiCall = useUpdateApiCall(),
2477
+ setCallApi = _useUpdateApiCall[1]; //single detail
2475
2478
  // const [, setNoteLoadingStore] = UseNotesLoading();
2476
2479
  var errorFound = function errorFound() {
2477
2480
  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;
@@ -2502,12 +2505,12 @@ function OrderDetailsFooter() {
2502
2505
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2503
2506
  while (1) switch (_context.prev = _context.next) {
2504
2507
  case 0:
2505
- setCallApi(true);
2506
2508
  payload = compareOrderDetailsStates(prevOrderDetails, orderDetails);
2507
- _context.next = 4;
2509
+ _context.next = 3;
2508
2510
  return updateOrder([payload]);
2509
- case 4:
2511
+ case 3:
2510
2512
  response = _context.sent;
2513
+ setCallApi(false);
2511
2514
  // setLogsCallAPi(prev => !prev);
2512
2515
  if (response && (response == null || (_response$data = response.data) == null ? void 0 : _response$data.length) > 0) {
2513
2516
  setOrderDetails(response == null ? void 0 : response.data[0]);
@@ -8481,8 +8484,8 @@ function OrderView() {
8481
8484
  var paths = splitPath(location.pathname);
8482
8485
  var _useLocationOptions = useLocationOptions(),
8483
8486
  setLocationOptions = _useLocationOptions[1];
8484
- var _useApiCalling = useApiCalling(),
8485
- apiCalling = _useApiCalling[0];
8487
+ var _useUpdateApiCall = useUpdateApiCall(),
8488
+ apiCalling = _useUpdateApiCall[0];
8486
8489
  var _useOrderProductsReso = useOrderProductsResources(),
8487
8490
  orderResources = _useOrderProductsReso[0],
8488
8491
  setOrderResources = _useOrderProductsReso[1];
@@ -8542,11 +8545,8 @@ function OrderView() {
8542
8545
  }
8543
8546
  }, [orderId, liveRecalling]);
8544
8547
  React.useEffect(function () {
8545
- if (apiCalling) {
8546
- orderUpdate(true);
8547
- } else {
8548
- orderUpdate(false);
8549
- }
8548
+ orderUpdate(true);
8549
+ apiCalling ? orderUpdate(true) : orderUpdate(false);
8550
8550
  }, [apiCalling]);
8551
8551
  React.useEffect(function () {
8552
8552
  if (paths.length > 1) {