add code blank for last case/complaint
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user