diff options
| author | Adam Soltys <[email protected]> | 2023-02-08 10:19:21 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-08 10:19:21 -0800 |
| commit | 204cf9ed18e4c643ebb4ec64439ac0c6afb1d1de (patch) | |
| tree | c8ef4632279287530b85a8131a7b999cc158567a /routes/payments.js | |
| parent | 949524dd9f0229f3b2fc9f6db7fd0670cf7aa96b (diff) | |
| download | coinos-server-204cf9ed18e4c643ebb4ec64439ac0c6afb1d1de.tar.gz coinos-server-204cf9ed18e4c643ebb4ec64439ac0c6afb1d1de.zip | |
don't return empty pots
Diffstat (limited to 'routes/payments.js')
| -rw-r--r-- | routes/payments.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/routes/payments.js b/routes/payments.js index a11934ea..7fa6b308 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -119,6 +119,7 @@ export default { async pot({ params: { name } }, res) { let amount = await g(`pot:${name}`); + if (!amount) fail("pot not found"); let payments = (await db.lRange(`pot:${name}:payments`, 0, -1)) || []; payments = await Promise.all(payments.map(hash => g(`payment:${hash}`))); |
