aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-08 00:05:58 -0800
committerAdam Soltys <[email protected]>2024-12-08 00:05:58 -0800
commitff18417db6c1190c3799b439f3bf3dd05c29f5df (patch)
treef5a54e9f995267637cbdb4e552529f8a4b3edcab
parent8cc54b3fc00bc4ee4e1c37edab042ce4f972d5c5 (diff)
downloadcoinos-server-ff18417db6c1190c3799b439f3bf3dd05c29f5df.tar.gz
coinos-server-ff18417db6c1190c3799b439f3bf3dd05c29f5df.zip
check account
-rw-r--r--routes/users.ts11
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());