@bjsdistribution/dms-client-return 0.0.67 → 0.0.68

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.
@@ -1746,14 +1746,23 @@ var ReturnOrderTable = function ReturnOrderTable() {
1746
1746
  setLoading(returnDataLoad);
1747
1747
  if (fetchedOrderData && fetchedOrderData != null && fetchedOrderData.data) {
1748
1748
  setReturnData(fetchedOrderData == null ? void 0 : fetchedOrderData.data);
1749
- if (paginationData !== null) {
1750
- var _JSON$parse = JSON.parse(paginationData),
1751
- rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded);
1752
- setPaginationObject(rest);
1749
+ if (paginationData) {
1750
+ try {
1751
+ var _JSON$parse = JSON.parse(paginationData),
1752
+ count = _JSON$parse.count,
1753
+ rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded);
1754
+ setPaginationObject(rest);
1755
+ } catch (error) {
1756
+ console.error('Error parsing paginationData:', error);
1757
+ notification.error({
1758
+ message: 'Error',
1759
+ description: 'Failed to parse pagination data'
1760
+ });
1761
+ }
1753
1762
  } else {
1754
1763
  notification.error({
1755
1764
  message: 'Error',
1756
- description: 'Pagination data is null'
1765
+ description: 'Pagination data is null or undefined'
1757
1766
  });
1758
1767
  }
1759
1768
  }
@@ -2821,6 +2830,11 @@ var OrderTable = function OrderTable() {
2821
2830
  color: '#845ADF',
2822
2831
  background: 'rgba(132, 90, 223, 0.15)'
2823
2832
  };
2833
+ case 'Awaiting':
2834
+ return {
2835
+ color: '#845ADF',
2836
+ background: 'rgba(132, 90, 223, 0.15)'
2837
+ };
2824
2838
  case 'Completed':
2825
2839
  return {
2826
2840
  color: '#1F9254',
@@ -2939,6 +2953,7 @@ var OrderTable = function OrderTable() {
2939
2953
  OO: 'On Hold',
2940
2954
  SC: 'Sub-Contracted',
2941
2955
  'awaiting route': 'Awaiting route',
2956
+ 'awaiting confirmation': 'Awaiting',
2942
2957
  completed: 'completed',
2943
2958
  outstanding: 'Outstanding',
2944
2959
  routed: 'Routed'
@@ -3615,14 +3630,23 @@ var ReturnAfterTable = function ReturnAfterTable() {
3615
3630
  setLoading(loading);
3616
3631
  if (fetchedReturnOrderData && fetchedReturnOrderData != null && fetchedReturnOrderData.data) {
3617
3632
  setReturnOrderData(fetchedReturnOrderData == null ? void 0 : fetchedReturnOrderData.data);
3618
- if (paginationData !== null) {
3619
- var _JSON$parse = JSON.parse(paginationData),
3620
- rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded$3);
3621
- setPaginationObject(rest);
3633
+ if (paginationData) {
3634
+ try {
3635
+ var _JSON$parse = JSON.parse(paginationData),
3636
+ count = _JSON$parse.count,
3637
+ rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded$3);
3638
+ setPaginationObject(rest);
3639
+ } catch (error) {
3640
+ console.error('Error parsing paginationData:', error);
3641
+ notification.error({
3642
+ message: 'Error',
3643
+ description: 'Failed to parse pagination data'
3644
+ });
3645
+ }
3622
3646
  } else {
3623
3647
  notification.error({
3624
3648
  message: 'Error',
3625
- description: 'Pagination data is null'
3649
+ description: 'Pagination data is null or undefined'
3626
3650
  });
3627
3651
  }
3628
3652
  }
@@ -11257,7 +11281,6 @@ function OrderView() {
11257
11281
  useEffect(function () {
11258
11282
  setLoading(depotDataLoading);
11259
11283
  if (fetchedDepotData && fetchedDepotData.data) {
11260
- console.log(fetchedDepotData, 'fetchedDepotData');
11261
11284
  var requiredData = fetchedDepotData == null ? void 0 : fetchedDepotData.data;
11262
11285
  if (requiredData.length > 0) {
11263
11286
  var options = requiredData == null ? void 0 : requiredData.map(function (x) {
@@ -11800,14 +11823,23 @@ function ReturnMainTable() {
11800
11823
  if (fetchedClientData && fetchedClientData.data) {
11801
11824
  var result = fetchedClientData == null ? void 0 : fetchedClientData.data;
11802
11825
  setClientData(result);
11803
- if (paginationData !== null) {
11804
- var _JSON$parse = JSON.parse(paginationData),
11805
- rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded$7);
11806
- setPaginationObject(rest);
11826
+ if (paginationData) {
11827
+ try {
11828
+ var _JSON$parse = JSON.parse(paginationData),
11829
+ count = _JSON$parse.count,
11830
+ rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded$7);
11831
+ setPaginationObject(rest);
11832
+ } catch (error) {
11833
+ console.error('Error parsing paginationData:', error);
11834
+ notification.error({
11835
+ message: 'Error',
11836
+ description: 'Failed to parse pagination data'
11837
+ });
11838
+ }
11807
11839
  } else {
11808
11840
  notification.error({
11809
11841
  message: 'Error',
11810
- description: 'Pagination data is null'
11842
+ description: 'Pagination data is null or undefined'
11811
11843
  });
11812
11844
  }
11813
11845
  }
@@ -11874,7 +11906,7 @@ function ReturnClient() {
11874
11906
  };
11875
11907
  var paths = splitPath(location.pathname);
11876
11908
  useEffect(function () {
11877
- if (paths[paths.length - 1] === 'orders/view/return') {
11909
+ if (paths.join('/') === 'orders/view/return') {
11878
11910
  setActionTypeOptions([]);
11879
11911
  setLocationOptions([]);
11880
11912
  setSelectedClient(null);
@@ -11882,11 +11914,6 @@ function ReturnClient() {
11882
11914
  setSelectedLocationValue(null);
11883
11915
  }
11884
11916
  }, [location.pathname, searchParams]);
11885
- // useEffect(() => {
11886
- // if (selectedClientId) {
11887
- // navigate(`filter/${selectedClientId}`);
11888
- // }
11889
- // }, [selectedClientId]);
11890
11917
  //API for client data
11891
11918
  var _useApiHook = useApiHook({
11892
11919
  endpoint: "/return_orders/customers/",