diff options
| author | Adam Soltys <[email protected]> | 2025-11-06 09:57:26 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-11-06 09:57:26 -0800 |
| commit | 16e031fcf1bc91c8692a6689c8e281efb2d3b381 (patch) | |
| tree | b8c56361dd38ffdb52ca9f4d9827c6b9bad1d80b | |
| parent | bc7a71360128539b6c5c42b5173fa8a2e4e9b9d6 (diff) | |
| download | coinos-server-16e031fcf1bc91c8692a6689c8e281efb2d3b381.tar.gz coinos-server-16e031fcf1bc91c8692a6689c8e281efb2d3b381.zip | |
don't return empty invoices
| -rw-r--r-- | routes/invoices.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/routes/invoices.ts b/routes/invoices.ts index fb7e319d..36869575 100644 --- a/routes/invoices.ts +++ b/routes/invoices.ts @@ -80,7 +80,9 @@ export default { async list(req, res) { const { id } = req.user; let invoices = await db.lRange(`${id}:invoices`, 0, -1); - invoices = await Promise.all(invoices.map((i) => getInvoice(i))); + invoices = (await Promise.all(invoices.map((i) => getInvoice(i)))).filter( + Boolean, + ); res.send(invoices); }, |
