Skip to content

Commit

Permalink
fix(api): fix amount calc when updating transaction (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
duongdev committed Jul 31, 2024
1 parent 1bb87f9 commit 6e68768
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/api/v1/routes/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const router = new Hono()
? category?.type === 'INCOME'
? Math.abs(data.amount)
: -Math.abs(data.amount)
: transaction.amount
: data.amount || transaction.amount

const updatedTransaction = await updateTransaction({
transactionId,
Expand Down

0 comments on commit 6e68768

Please sign in to comment.