From fb0cc42f8f6812e270fe27f59e2264e7b40eb77f Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 30 Sep 2024 10:53:49 -0300 Subject: [PATCH] fix: payment amount --- src/components/payment-table.tsx | 4 ++-- src/components/transactions-and-payments-table.tsx | 2 +- src/lib/utils.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/payment-table.tsx b/src/components/payment-table.tsx index 5e5beb3..a78ade5 100644 --- a/src/components/payment-table.tsx +++ b/src/components/payment-table.tsx @@ -95,11 +95,11 @@ export const columns: ColumnDef[] = [ ), }, { - accessorKey: 'amount', + accessorKey: 'amountInCrypto', header: 'Amount', cell: ({ row }) => getAmountWithCurrencySymbol( - row.getValue('amount'), + row.getValue('amountInCrypto'), row.original?.tokenAddress, ), }, diff --git a/src/components/transactions-and-payments-table.tsx b/src/components/transactions-and-payments-table.tsx index a2516fa..a366ab2 100644 --- a/src/components/transactions-and-payments-table.tsx +++ b/src/components/transactions-and-payments-table.tsx @@ -110,7 +110,7 @@ export function TransactionsAndPaymentsTable({ item?.dataObject?.data?.parameters?.currency?.value, ) : getAmountWithCurrencySymbol( - BigInt(item?.amount), + BigInt(item?.amountInCrypto), item?.tokenAddress, )} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index f612b6a..e3eb72a 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -171,7 +171,7 @@ export const getPaymentDataFromCreateTransaction = ( export const getBalance = (payments: Payment[] | undefined) => { return payments ? payments - .map((payment) => BigInt(payment.amount)) + .map((payment) => BigInt(payment.amountInCrypto)) .reduce((a, b) => a + b, BigInt(0)) : 0; };