Skip to content

Commit

Permalink
[SDP-1278] fixes post python migration (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelosalloum authored Jul 26, 2024
1 parent 58515e5 commit 44d94d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/helpers/formatReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const formatReceiver = (receiver: ApiReceiver): ReceiverDetails => ({
email: receiver.email,
orgId: receiver.external_id,
// TODO: how to handle multiple
assetCode: receiver.received_amounts?.[0].asset_code,
totalReceived: receiver.received_amounts?.[0].received_amount,
assetCode: receiver.received_amounts?.[0]?.asset_code,
totalReceived: receiver.received_amounts?.[0]?.received_amount,
stats: {
paymentsTotalCount: Number(receiver.total_payments),
paymentsSuccessfulCount: Number(receiver.successful_payments),
Expand All @@ -24,8 +24,8 @@ export const formatReceiver = (receiver: ApiReceiver): ReceiverDetails => ({
smsLastSentAt: w.last_sms_sent,
totalPaymentsCount: Number(w.payments_received),
// TODO: how to handle multiple
assetCode: w.received_amounts[0].asset_code,
totalAmountReceived: w.received_amounts[0].received_amount,
assetCode: w.received_amounts?.[0]?.asset_code,
totalAmountReceived: w.received_amounts?.[0]?.received_amount,
// TODO: withdrawn amount
withdrawnAmount: "",
})),
Expand Down

0 comments on commit 44d94d4

Please sign in to comment.