continue: made a payments method list

This commit is contained in:
smanylov
2026-04-03 14:52:31 +07:00
parent e75fcd7bff
commit 6cf7bd766d
8 changed files with 376 additions and 31 deletions
@@ -1,12 +1,13 @@
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 interface PaymentsMethods {
cardType: string,
expiryMonth: string,
expiryYear: string,
lastFour: string,
paymentMethodId: string
}
export const usePaymentsMethods = () => {
return useQuery({
@@ -14,7 +15,7 @@ export const usePaymentsMethods = () => {
queryFn: () => {
return getPaymentsMethods()
},
select: (data: any | null) => {
select: (data: PaymentsMethods[] | null) => {
if (!data) {
return null
}