From 7acd72d3d4efded612d84e7212289b6d8b22aa37 Mon Sep 17 00:00:00 2001 From: CynthiaKamau Date: Tue, 19 Mar 2024 16:46:04 +0300 Subject: [PATCH] (fix) Fixed snackbar error messages causing react minified error --- .../create-edit/add-billable-service.component.tsx | 2 +- src/billing-form/billing-form.component.tsx | 4 ++-- src/billing.resource.ts | 2 +- src/invoice/payments/payments.component.tsx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/billable-services/create-edit/add-billable-service.component.tsx b/src/billable-services/create-edit/add-billable-service.component.tsx index d0331e0..b24cfb2 100644 --- a/src/billable-services/create-edit/add-billable-service.component.tsx +++ b/src/billable-services/create-edit/add-billable-service.component.tsx @@ -122,7 +122,7 @@ const AddBillableService: React.FC = () => { handleNavigateToServiceDashboard(); }, (error) => { - showSnackbar({ title: 'Bill payment error', kind: 'error', subtitle: error }); + showSnackbar({ title: 'Bill payment error', kind: 'error', subtitle: error?.message }); }, ); }; diff --git a/src/billing-form/billing-form.component.tsx b/src/billing-form/billing-form.component.tsx index c65d1c6..717944a 100644 --- a/src/billing-form/billing-form.component.tsx +++ b/src/billing-form/billing-form.component.tsx @@ -167,7 +167,7 @@ const BillingForm: React.FC = ({ patientUuid, closeWorkspace } }; billItems.forEach((item) => { - const lineItem: any = { + let lineItem: any = { quantity: parseInt(item.Qnty), price: item.Price, priceName: 'Default', @@ -198,7 +198,7 @@ const BillingForm: React.FC = ({ patientUuid, closeWorkspace } }); }, (error) => { - showSnackbar({ title: 'Bill processing error', kind: 'error', subtitle: error }); + showSnackbar({ title: 'Bill processing error', kind: 'error', subtitle: error?.message }); }, ); }; diff --git a/src/billing.resource.ts b/src/billing.resource.ts index ba0385b..db0ff04 100644 --- a/src/billing.resource.ts +++ b/src/billing.resource.ts @@ -6,7 +6,7 @@ import sortBy from 'lodash-es/sortBy'; import { apiBasePath } from './constants'; export const useBills = (patientUuid: string = '', billStatus: string = '') => { - const url = `${apiBasePath}bill?v=full`; + const url = `${apiBasePath}bill?v=full&limit=1000`; const { data, error, isLoading, isValidating, mutate } = useSWR<{ data: { results: Array } }>( url, diff --git a/src/invoice/payments/payments.component.tsx b/src/invoice/payments/payments.component.tsx index 9406c47..e5d0369 100644 --- a/src/invoice/payments/payments.component.tsx +++ b/src/invoice/payments/payments.component.tsx @@ -77,7 +77,7 @@ const Payments: React.FC = ({ bill, selectedLineItems }) => { handleNavigateToBillingDashboard(); }, (error) => { - showSnackbar({ title: 'Bill payment error', kind: 'error', subtitle: error }); + showSnackbar({ title: 'Bill payment error', kind: 'error', subtitle: error?.message }); }, ); };