Skip to content

Commit

Permalink
(feat) Remove spurious use of lodash isEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Dec 1, 2023
1 parent 7f66116 commit ac39edb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/esm-billing-app/src/billing.resource.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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 @@ -38,7 +37,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 = isEmpty(patientUuid) ? mappedResults : filteredResults || [];
const formattedBills = patientUuid ? mappedResults : filteredResults || [];

return {
bills: formattedBills,
Expand Down

0 comments on commit ac39edb

Please sign in to comment.