Skip to content

Commit

Permalink
fix(api): calculate wallet balance from transaction amountInVnd (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkdev98 committed Aug 21, 2024
1 parent e3f9954 commit 1ffb7b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/api/v1/services/wallet.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export async function getWalletBalance({
const balance = await prisma.transaction.aggregate({
where: { walletAccountId: wallet.id },
// biome-ignore lint/style/useNamingConvention: <explanation>
_sum: { amount: true },
_sum: { amountInVnd: true },
})

return balance._sum.amount || 0
return balance._sum.amountInVnd || 0
}

// biome-ignore lint/correctness/noUnusedVariables: <explanation>
Expand Down

0 comments on commit 1ffb7b4

Please sign in to comment.