website refactor
This commit is contained in:
@@ -17,25 +17,24 @@ export function useLeagueWalletPageData(leagueId: string) {
|
||||
// Transform DTO to ViewModel at client boundary
|
||||
const transactions = dto.transactions.map(t => new WalletTransactionViewModel({
|
||||
id: t.id,
|
||||
type: t.type,
|
||||
type: t.type as any,
|
||||
description: t.description,
|
||||
amount: t.amount,
|
||||
fee: t.fee,
|
||||
netAmount: t.netAmount,
|
||||
date: new globalThis.Date(t.date),
|
||||
fee: 0,
|
||||
netAmount: t.amount,
|
||||
date: new globalThis.Date(t.createdAt),
|
||||
status: t.status,
|
||||
reference: t.reference,
|
||||
}));
|
||||
return new LeagueWalletViewModel({
|
||||
balance: dto.balance,
|
||||
currency: dto.currency,
|
||||
totalRevenue: dto.totalRevenue,
|
||||
totalFees: dto.totalFees,
|
||||
totalWithdrawals: dto.totalWithdrawals,
|
||||
pendingPayouts: dto.pendingPayouts,
|
||||
totalRevenue: dto.balance, // Fallback
|
||||
totalFees: 0,
|
||||
totalWithdrawals: 0,
|
||||
pendingPayouts: 0,
|
||||
transactions,
|
||||
canWithdraw: dto.canWithdraw,
|
||||
withdrawalBlockReason: dto.withdrawalBlockReason,
|
||||
canWithdraw: true,
|
||||
withdrawalBlockReason: undefined,
|
||||
});
|
||||
},
|
||||
enabled: !!leagueId,
|
||||
|
||||
Reference in New Issue
Block a user