Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: chibongho <[email protected]>
  • Loading branch information
brandones and chibongho authored Aug 1, 2024
1 parent 96882db commit ea1c906
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/esm-ward-app/src/hooks/useMostRecentObs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export function useMostRecentObs(criteria?: ObsSearchCriteria, representation =

const apiUrl = `${restBaseUrl}/obs?${params}`;

const { data, isLoading, isValidating, error } = useSWR<{ data: { results: Array<Observation>; totalCount: number; links: Array<Link> } }, Error>(
const { data, ...rest } = useSWR<{ data: { results: Array<Observation>; totalCount: number; links: Array<Link> } }, Error>(
apiUrl,
openmrsFetch,
);

const obs = data?.data?.results?.[0];

return { data: obs, isLoading, isValidating, error };
return { data: obs, ...rest };
}

0 comments on commit ea1c906

Please sign in to comment.