Skip to content

Commit

Permalink
Update admin.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
squi-ddy authored Oct 29, 2024
1 parent 14a9230 commit 0714797
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/src/api/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ router.post("/addMoney", async (req, res) => {
return res.status(400).json({ message: "Amount must be a string" })
}

if (amount.lte(0)) {
return res.status(400).json({ message: "Amount must be positive" })
}

if (!amount.isFinite()) {
return res.status(400).json({ message: "No scamming" })
}

// add money to user
await sql.begin("ISOLATION LEVEL REPEATABLE READ", async (sql) => {
// get topup
Expand Down

0 comments on commit 0714797

Please sign in to comment.