add token for fetch violation list
This commit is contained in:
@@ -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
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user