@mseva/digit-ui-module-garbagecollection 1.0.29 → 1.0.30

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.
@@ -11752,13 +11752,21 @@ const ChallanApplicationDetails = () => {
11752
11752
  }
11753
11753
  }, [acknowledgementIds]);
11754
11754
  const getAcknowledgement = async () => {
11755
- const applications = getChallanData;
11756
- console.log("applications for garbage", applications);
11757
- const tenantInfo = tenants.find(tenant => tenant.code === applications.tenantId);
11758
- const acknowldgementDataAPI = await getAcknowledgementData({
11759
- ...applications
11760
- }, tenantInfo, t);
11761
- Digit.Utils.pdf.generate(acknowldgementDataAPI);
11755
+ setLoader(true);
11756
+ try {
11757
+ const applications = getChallanData;
11758
+ const tenantInfo = tenants.find(tenant => tenant.code === applications.tenantId);
11759
+ const acknowldgementDataAPI = await getAcknowledgementData({
11760
+ ...applications
11761
+ }, tenantInfo, t);
11762
+ setTimeout(() => {
11763
+ Digit.Utils.pdf.generate(acknowldgementDataAPI);
11764
+ setLoader(false);
11765
+ }, 0);
11766
+ } catch (error) {
11767
+ console.error("Error generating acknowledgement:", error);
11768
+ setLoader(false);
11769
+ }
11762
11770
  };
11763
11771
  const workflowDetails = Digit.Hooks.useWorkflowDetails({
11764
11772
  tenantId: tenantId,
@@ -11798,23 +11806,30 @@ const ChallanApplicationDetails = () => {
11798
11806
  payments,
11799
11807
  ...params
11800
11808
  }) {
11801
- var _response;
11802
- let response = null;
11803
- if (payments !== null && payments !== void 0 && payments.fileStoreId) {
11804
- response = {
11805
- filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
11806
- };
11807
- } else {
11808
- response = await Digit.PaymentService.generatePdf(tenantId, {
11809
- Payments: [{
11810
- ...payments
11811
- }]
11812
- }, "garbage-receipt");
11813
- }
11814
- const fileStore = await Digit.PaymentService.printReciept(tenantId, {
11815
- fileStoreIds: response.filestoreIds[0]
11816
- });
11817
- window.open(fileStore[(_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]], "_blank");
11809
+ setLoader(true);
11810
+ try {
11811
+ var _response;
11812
+ let response = null;
11813
+ if (payments !== null && payments !== void 0 && payments.fileStoreId) {
11814
+ response = {
11815
+ filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
11816
+ };
11817
+ } else {
11818
+ response = await Digit.PaymentService.generatePdf(tenantId, {
11819
+ Payments: [{
11820
+ ...payments
11821
+ }]
11822
+ }, "garbage-receipt");
11823
+ }
11824
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
11825
+ fileStoreIds: response.filestoreIds[0]
11826
+ });
11827
+ setLoader(false);
11828
+ window.open(fileStore[(_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]], "_blank");
11829
+ } catch (error) {
11830
+ console.error(error);
11831
+ setLoader(false);
11832
+ }
11818
11833
  }
11819
11834
  if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
11820
11835
  dowloadOptions.push({
@@ -11981,13 +11996,22 @@ const GCResponseCitizen = props => {
11981
11996
  }
11982
11997
  };
11983
11998
  const getAcknowledgement = async () => {
11984
- const applications = getChallanData;
11985
- console.log('applications for garbage', applications);
11986
- const tenantInfo = tenants.find(tenant => tenant.code === applications.tenantId);
11987
- const acknowldgementDataAPI = await getAcknowledgementData({
11988
- ...applications
11989
- }, tenantInfo, t);
11990
- Digit.Utils.pdf.generate(acknowldgementDataAPI);
11999
+ try {
12000
+ setLoader(true);
12001
+ const applications = getChallanData;
12002
+ console.log('applications for garbage', applications);
12003
+ const tenantInfo = tenants.find(tenant => tenant.code === applications.tenantId);
12004
+ const acknowldgementDataAPI = await getAcknowledgementData({
12005
+ ...applications
12006
+ }, tenantInfo, t);
12007
+ setTimeout(() => {
12008
+ Digit.Utils.pdf.generate(acknowldgementDataAPI);
12009
+ setLoader(false);
12010
+ }, 0);
12011
+ } catch (error) {
12012
+ console.error("Error generating acknowledgement:", error);
12013
+ setLoader(false);
12014
+ }
11991
12015
  };
11992
12016
  const closeToast = () => {
11993
12017
  setShowToast(null);
@@ -12042,6 +12066,8 @@ const GCResponseCitizen = props => {
12042
12066
  label: getLable,
12043
12067
  isDleteBtn: true,
12044
12068
  onClose: closeToast
12069
+ }), loader && /*#__PURE__*/React.createElement(Loader, {
12070
+ page: true
12045
12071
  }));
12046
12072
  };
12047
12073