Skip to content

Commit

Permalink
Merge pull request #1 from Mingy123/patch-1
Browse files Browse the repository at this point in the history
Disallow NaN in transactions
  • Loading branch information
squi-ddy authored Oct 29, 2024
2 parents 1c90118 + 309df87 commit 14a9230
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/src/api/student.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ router.post("/createTransaction", async (req, res) => {
if (amountToDP.lte(0)) {
return res.status(400).json({ message: "Amount must be positive" })
}
if (!amountToDP.isFinite()) {
return res.status(400).json({ message: "Invalid Amount" })
}

const transId = getRandom()

Expand Down

0 comments on commit 14a9230

Please sign in to comment.