diff --git a/src/billable-services/billable-service.resource.ts b/src/billable-services/billable-service.resource.ts index a62ef92..d52db19 100644 --- a/src/billable-services/billable-service.resource.ts +++ b/src/billable-services/billable-service.resource.ts @@ -11,43 +11,6 @@ type ResponseObject = { export const useBillableServices = () => { const url = `${apiBasePath}billableService?v=custom:(uuid,name,shortName,serviceStatus,serviceType:(display),servicePrices:(uuid,name,price))`; - // Instead of generating with Faker.js, manually create some mock data for testing - const generateMockBillableServices = (count: number): BillableService[] => { - const mockBillableServices: BillableService[] = Array.from({ length: count }, (_, i) => ({ - uuid: `uuid-${i}`, - name: `Service ${i}`, - shortName: `Short Name ${i}`, - serviceStatus: i % 2 === 0 ? 'Active' : 'Inactive', - serviceType: { display: `Type ${i % 5}` }, - servicePrices: [ - { - name: `Price Type ${i}`, - price: (i + 1) * 10, - }, - ], - })); - - // Log the mock data to the console - // console.log('Mock Billable Services:', mockBillableServices); - - return mockBillableServices; - }; - - const useMockData = true; // Set this to true for testing - - // If testing, generate mock data instead of using the real API - if (useMockData) { - const mockBillableServices = generateMockBillableServices(100); // Generate 100 mock services - return { - billableServices: mockBillableServices, - isLoading: false, - isValidating: false, - error: null, - mutate: () => {}, - }; - } - - // Fetch real data when not in testing mode const { data, isLoading, isValidating, error, mutate } = useOpenmrsFetchAll(url); return {