add code blank for last case/complaint

This commit is contained in:
smanylov
2026-04-16 17:34:14 +07:00
parent cbf30604af
commit fcc1f3bec9
3 changed files with 114 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import { useQuery } from '@tanstack/react-query';
import { fetchLastCase } from '@/app/actions/violationActions';
export interface useLastCase {
test: number,
}
export const useLastCases = () => {
return useQuery({
queryKey: ['lastCases'],
queryFn: () => {
return fetchLastCase()
},
select: (data: useLastCase | null) => {
if (!data) {
return null
}
return data;
},
retry: false
});
};
@@ -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
});
};