Add stats
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { fetchDailySummary, fetchTimetable, fetchWakeSleepTimes } from '../api/client';
|
||||
import type { DailySummaryResponse, TimetableResponse, WakeupBedtimeResponse } from '../types';
|
||||
import { fetchDailySummary, fetchTimetable, fetchWakeSleepTimes, fetchSummary } from '../api/client';
|
||||
import type { DailySummaryResponse, TimetableResponse, WakeupBedtimeResponse, SummaryResponse } from '../types';
|
||||
|
||||
export function useSummary(from_date: string, to_date: string) {
|
||||
return useQuery<SummaryResponse>({
|
||||
queryKey: ['summary', from_date, to_date],
|
||||
queryFn: () => fetchSummary(from_date, to_date),
|
||||
});
|
||||
}
|
||||
|
||||
export function useStats(
|
||||
from_date: string,
|
||||
|
||||
Reference in New Issue
Block a user