forked from Savitura/crowdpay
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparseint-radix-fix.patch
More file actions
37 lines (33 loc) · 1.63 KB
/
Copy pathparseint-radix-fix.patch
File metadata and controls
37 lines (33 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff --git a/backend/src/routes/contributions.js b/backend/src/routes/contributions.js
index d3b1d61..c95743d 100644
--- a/backend/src/routes/contributions.js
+++ b/backend/src/routes/contributions.js
@@ -163,8 +163,8 @@ router.get('/dashboard/export.csv', requireAuth, asyncHandler(async (req, res) =
}));
router.get('/campaign/:campaignId', async (req, res) => {
- const limit = Math.min(parseInt(req.query.limit) || 20, 100);
- const offset = Math.max(parseInt(req.query.offset) || 0, 0);
+ const limit = Math.min(parseInt(req.query.limit, 10) || 20, 100);
+ const offset = Math.max(parseInt(req.query.offset, 10) || 0, 0);
const { rows } = await db.query(
`SELECT c.id, c.sender_public_key, c.amount, c.asset, c.payment_type,
diff --git a/backend/src/routes/wallets.js b/backend/src/routes/wallets.js
index ec36046..12911d4 100644
--- a/backend/src/routes/wallets.js
+++ b/backend/src/routes/wallets.js
@@ -47,7 +47,7 @@ router.get('/:campaignId/transactions', requireAuth, async (req, res) => {
return res.status(403).json({ error: 'Unauthorized' });
}
- const limit = parseInt(req.query.limit) || 50;
+ const limit = parseInt(req.query.limit, 10) || 50;
const txs = await getWalletTransactionHistory(rows[0].wallet_public_key, limit);
res.json(txs);
});
@@ -63,7 +63,7 @@ router.get('/:campaignId/payments', requireAuth, async (req, res) => {
return res.status(403).json({ error: 'Unauthorized' });
}
- const limit = parseInt(req.query.limit) || 100;
+ const limit = parseInt(req.query.limit, 10) || 100;
const payments = await getWalletPayments(rows[0].wallet_public_key, limit);
res.json(payments);
});