add token for fetch violation list

This commit is contained in:
smanylov
2026-03-18 18:09:33 +07:00
parent 89e288c591
commit 9907213dd8
4 changed files with 67 additions and 2 deletions
@@ -0,0 +1,24 @@
import { useQuery } from '@tanstack/react-query';
import { fetchViolationGeography } from '@/app/actions/violationActions';
export interface UseViolationGeography {
ru: number;
usa: number;
uk: number;
ge: number;
}
export const useViolationGeography = () => {
return useQuery({
queryKey: ['violationGeography'],
queryFn: fetchViolationGeography,
select: (data): any | null => {
if (!data) {
return []
}
return data;
},
retry: false
});
};