Skip to content

Commit

Permalink
[bugfix] set lastRepaymentAmount 0 when is null (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Pedro da Silva authored Sep 28, 2023
1 parent bdb9132 commit 6d241a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/microcredit/src/borrowers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function updateBorrowers(): Promise<void> {
const borrower = borrowers.borrowers.find(el => el.id === user.address.toLowerCase());
const values = {
lastRepayment: borrower!.loan.lastRepayment,
lastRepaymentAmount: parseFloat(borrower!.loan.lastRepaymentAmount),
lastRepaymentAmount: borrower!.loan.lastRepaymentAmount ? parseFloat(borrower!.loan.lastRepaymentAmount) : 0,
lastDebt: parseFloat(borrower!.loan.lastDebt),
amount: parseFloat(borrower!.loan.amount),
period: borrower!.loan.period,
Expand Down

0 comments on commit 6d241a3

Please sign in to comment.