Skip to content

Commit

Permalink
use real query
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickCleary committed Jul 15, 2023
1 parent 6cd62b0 commit f179994
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions modules/landing/LandingCharts.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
import React from 'react';
import { useQuery } from '@tanstack/react-query';
import { fetchActualTripsByLine } from '../../common/api/tripmetrics';
import { useDeliveredTripMetrics } from '../../common/api/hooks/tripmetrics';
import { TODAY_STRING } from '../../common/constants/dates';
import { ONE_HOUR } from '../../common/constants/time';
import { OverallSpeedChartWrapper } from './charts/OverallSpeedChartWrapper';
import { OverallServiceChartWrapper } from './charts/OverallServiceChartWrapper';
import { OverallRidershipChartWrapper } from './charts/OverallRidershipChartWrapper';
import { LandingChartWidget } from './LandingChartWidget';

export const LandingCharts: React.FC = () => {
// This query is just to get the lambdas "warm"
useQuery(
['primer'],
() =>
fetchActualTripsByLine({
agg: 'daily',
start_date: TODAY_STRING,
end_date: TODAY_STRING,
line: 'line-red',
}),
{
staleTime: ONE_HOUR,
}
);
useDeliveredTripMetrics({
agg: 'daily',
start_date: TODAY_STRING,
end_date: TODAY_STRING,
line: 'line-red',
});
return (
<div className="flex flex-col items-center gap-8">
<LandingChartWidget title="Speed">
Expand Down

0 comments on commit f179994

Please sign in to comment.