From cb9d32933482ccca080786697c718266023faf5b Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 28 Aug 2023 06:33:22 +0000 Subject: wip --- routes/payments.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'routes') diff --git a/routes/payments.js b/routes/payments.js index 425561f1..c13f7bec 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -232,6 +232,7 @@ export default { }, async take({ body: { name, amount, hash }, user }, res) { + try { amount = parseInt(amount); if (amount < 0) fail("Invalid amount"); @@ -258,6 +259,9 @@ export default { await db.lPush(`pot:${name}:payments`, hash); res.send({ payment }); + } catch(e) { + bail(res, e.message); + } }, async bitcoin({ body: { txid, wallet } }, res) { -- cgit v1.2.3