add PayoutMethod, getReferralPayments,
add translates
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import {getUserPayments} from '@/app/actions/referralsActions';
|
||||
|
||||
export interface PaymentsData {
|
||||
amount: number,
|
||||
cancellationReason: string | null,
|
||||
createdAt: string,
|
||||
id: number,
|
||||
operationType: string,
|
||||
paymentUuid: string,
|
||||
status: string,
|
||||
updatedAt: string,
|
||||
}
|
||||
|
||||
|
||||
export interface UserPayments {
|
||||
payments: PaymentsData[],
|
||||
error: string | null
|
||||
}
|
||||
|
||||
export const useGetReferralPayments = () => {
|
||||
return useQuery({
|
||||
queryKey: ['referralPayments'],
|
||||
queryFn: getUserPayments,
|
||||
select: (data): UserPayments => {
|
||||
/* console.log('referralPayments');
|
||||
console.log(data); */
|
||||
if (!data) {
|
||||
return {
|
||||
payments: [],
|
||||
error: null
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
},
|
||||
retry: false
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user