Files
no-copy-frontend/src/app/hooks/react-query/useLastComplaints.ts
T

22 lines
448 B
TypeScript
Raw Normal View History

2026-04-16 17:34:14 +07:00
import { useQuery } from '@tanstack/react-query';
import { fetchLastComplaint } from '@/app/actions/violationActions';
export interface useLastComplaint {
test: number,
}
export const useLastComplaints = () => {
return useQuery({
queryKey: ['lastComplaints'],
queryFn: () => {
return fetchLastComplaint()
},
select: (data: useLastComplaint | null) => {
if (!data) {
return null
}
return data;
},
retry: false
});
};