add payments method list

This commit is contained in:
smanylov
2026-04-02 17:59:47 +07:00
parent d6dee3361e
commit 0097f768ef
6 changed files with 102 additions and 1 deletions
@@ -0,0 +1,25 @@
import { useQuery } from '@tanstack/react-query';
import { getPaymentsMethods } from '@/app/actions/paymentAction';
/* export interface PaymentsMethods {
total_violations: number,
new_violations: number,
in_progress_violations: number,
resolved_violations: number
} */
export const usePaymentsMethods = () => {
return useQuery({
queryKey: ['paymentsMethods'],
queryFn: () => {
return getPaymentsMethods()
},
select: (data: any | null) => {
if (!data) {
return null
}
return data;
},
retry: false
});
};