Skip to content

Commit

Permalink
solve error: cannot read proeprties of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
mccarthyaaron authored and denniskigen committed Sep 3, 2024
1 parent db3d685 commit 30e6f9b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function useInfiniteVisits(patientUuid: string) {
);

return {
visits: data ? [].concat(data?.flatMap((page) => page.data.results)) : null,
visits: data ? [].concat(data?.flatMap((page) => page?.data?.results)) : null,
error,
hasMore: data?.length ? !!data[data.length - 1].data?.links?.some((link) => link.rel === 'next') : false,
isLoading,
Expand Down

0 comments on commit 30e6f9b

Please sign in to comment.