diff options
Diffstat (limited to 'frontend/src/apis/hooks/histories.ts')
-rw-r--r-- | frontend/src/apis/hooks/histories.ts | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/frontend/src/apis/hooks/histories.ts b/frontend/src/apis/hooks/histories.ts index d8fc0676f..6368d11db 100644 --- a/frontend/src/apis/hooks/histories.ts +++ b/frontend/src/apis/hooks/histories.ts @@ -1,6 +1,6 @@ -import { useQuery } from "react-query"; -import { QueryKeys } from "../queries/keys"; -import api from "../raw"; +import { useQuery } from "@tanstack/react-query"; +import { QueryKeys } from "@/apis/queries/keys"; +import api from "@/apis/raw"; export function useHistoryStats( time: History.TimeFrameOptions, @@ -8,14 +8,19 @@ export function useHistoryStats( provider: System.Provider | null, language: Language.Info | null, ) { - return useQuery( - [QueryKeys.System, QueryKeys.History, { time, action, provider, language }], - () => + return useQuery({ + queryKey: [ + QueryKeys.System, + QueryKeys.History, + { time, action, provider, language }, + ], + + queryFn: () => api.history.stats( time, action ?? undefined, provider?.name, language?.code2, ), - ); + }); } |