diff options
| -rw-r--r-- | routes/users.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/routes/users.ts b/routes/users.ts index 9588727f..6efe61e3 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -638,7 +638,7 @@ export default { async account(req, res) { const { id } = req.params; const account = await g(`account:${id}`); - account.balance = await g(`balance:${id}`); + if (account) account.balance = await g(`balance:${id}`); res.send(account); }, @@ -649,11 +649,10 @@ export default { const accounts = []; for (const id of await db.lRange(`${user.id}:accounts`, 0, -1)) { const account = await g(`account:${id}`); - account.balance = await g(`balance:${id}`); - - // if (account.seed) reconcile(account); - - accounts.push(account); + if (account) { + account.balance = await g(`balance:${id}`); + accounts.push(account); + } } res.send(accounts.reverse()); |
