Skip to content

Commit

Permalink
feat: use now both for dateTo and dateFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
thoreyjona committed Oct 10, 2024
1 parent b314585 commit 4a244df
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions apps/native/app/src/screens/health/health-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,16 @@ export const HealthOverviewScreen: NavigationFunctionComponent = ({
const [refetching, setRefetching] = useState(false)

const now = useMemo(() => new Date().toISOString(), [])
const dayOfYesterday = useMemo(() => new Date().getDate() - 1, [])
const yesterday = useMemo(
() => new Date(new Date().setDate(dayOfYesterday)).toISOString(),
[dayOfYesterday],
)

const healthInsuranceRes = useGetHealthInsuranceOverviewQuery()
const healthCenterRes = useGetHealthCenterQuery()
const paymentStatusRes = useGetPaymentStatusQuery()
const paymentOverviewRes = useGetPaymentOverviewQuery({
variables: {
input: {
dateFrom: yesterday,
// The items we are fethcing are static and are not using the dates for calculation,
// it is though not allowed to skip them or send and empty string so we send current date for both
dateFrom: now,
dateTo: now,
serviceTypeCode: '',
},
Expand Down

0 comments on commit 4a244df

Please sign in to comment.