diff options
| author | Adam Soltys <[email protected]> | 2020-09-16 23:05:14 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-09-16 23:05:14 -0700 |
| commit | 49883ffcf2b01f4ca85f87cd55ba17cc8d6aaea9 (patch) | |
| tree | eb3befe88898a91a153690729d025e5f339f4cbf /routes/users.js | |
| parent | 55a37c3a545928553d6a540431f6266cb24fa401 (diff) | |
| download | coinos-server-49883ffcf2b01f4ca85f87cd55ba17cc8d6aaea9.tar.gz coinos-server-49883ffcf2b01f4ca85f87cd55ba17cc8d6aaea9.zip | |
add account network, fix internal asset transfers
Diffstat (limited to 'routes/users.js')
| -rw-r--r-- | routes/users.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/routes/users.js b/routes/users.js index d1bdfc0c..5de71a54 100644 --- a/routes/users.js +++ b/routes/users.js @@ -259,7 +259,7 @@ app.post( "/accounts", auth, ah(async (req, res) => { - const { name, seed, pubkey, ticker, precision, path } = req.body; + const { name, seed, pubkey, ticker, precision, path, network } = req.body; const { user } = req; let account = await db.Account.create({ @@ -272,7 +272,8 @@ app.post( precision, pubkey, seed, - path + path, + network }); emit(user.username, "account", account); @@ -421,12 +422,12 @@ app.post( pubkey, path, hide, - index, + index } = req.body; try { await db.Account.update( - { name, ticker, precision, domain, seed, pubkey, path, hide }, + { name, ticker, precision, domain, seed, pubkey, path, hide, index }, { where: { id, user_id: user.id } } @@ -472,12 +473,12 @@ app.post( } }); user.payments = payments; - user.account = account; + user.account = account.get({ plain: true }); - emit(user.username, "account", account.get({ plain: true })); + emit(user.username, "account", user.account); emit(user.username, "user", user); - res.end(); + res.send(user); } catch (e) { l.error(e.message); return res.status(500).send("There was a problem switching accounts"); |
