|
@@ -6,7 +6,10 @@ export const fetchList = async (token: string) => {
|
|
|
try {
|
|
|
const data: PostGetList = await queryClient.fetchQuery({
|
|
|
queryKey: statisticsQueryKeys.getList(token),
|
|
|
- queryFn: () => statisticsApi.getList(token).then((res) => res.data),
|
|
|
+ queryFn: async () => {
|
|
|
+ const response = await statisticsApi.getList(token);
|
|
|
+ return response.data;
|
|
|
+ },
|
|
|
gcTime: 0,
|
|
|
staleTime: 0
|
|
|
});
|
|
@@ -21,7 +24,10 @@ export const fetchStatistic = async (token: string, url1: string, url2: string)
|
|
|
try {
|
|
|
const data: PostGetStat = await queryClient.fetchQuery({
|
|
|
queryKey: statisticsQueryKeys.getStatistic(token, url1, url2),
|
|
|
- queryFn: () => statisticsApi.getStatistic(token, url1, url2).then((res) => res.data),
|
|
|
+ queryFn: async () => {
|
|
|
+ const response = await statisticsApi.getStatistic(token, url1, url2);
|
|
|
+ return response.data;
|
|
|
+ },
|
|
|
gcTime: 0,
|
|
|
staleTime: 0
|
|
|
});
|