Skip to content

Commit

Permalink
Revert "(feat) Remove spurious use of lodash isEmpty"
Browse files Browse the repository at this point in the history
This reverts commit 88c4157.
  • Loading branch information
denniskigen committed Dec 1, 2023
1 parent 88c4157 commit 01e4418
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/esm-billing-app/src/billing.resource.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import useSWR from 'swr';
import { formatDate, parseDate, openmrsFetch } from '@openmrs/esm-framework';
import { MappedBill, PatientInvoice } from './types';
import isEmpty from 'lodash-es/isEmpty';

export const useBills = (patientUuid?: string) => {
const url = `/ws/rest/v1/cashier/bill?v=full`;
Expand Down Expand Up @@ -37,7 +38,7 @@ export const useBills = (patientUuid?: string) => {

const mappedResults = data?.data ? data?.data?.results?.map((res) => mapBillProperties(res)) : [];
const filteredResults = mappedResults?.filter((res) => res.patientUuid === patientUuid);
const formattedBills = patientUuid ? mappedResults : filteredResults || [];
const formattedBills = isEmpty(patientUuid) ? mappedResults : filteredResults || [];

return {
bills: formattedBills,
Expand Down

0 comments on commit 01e4418

Please sign in to comment.