diff options
| author | Adam Soltys <[email protected]> | 2022-08-26 10:48:29 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-08-26 10:48:29 -0700 |
| commit | a86552b716837e227788e52cd559ae4f1ec07a01 (patch) | |
| tree | 79b5260c9350f481903585614366e302fc9c7e46 /routes | |
| parent | 05b5dc758285a5f396f9973fa91bd5643dbbbc7a (diff) | |
| download | coinos-server-a86552b716837e227788e52cd559ae4f1ec07a01.tar.gz coinos-server-a86552b716837e227788e52cd559ae4f1ec07a01.zip | |
combine compose yml files
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/send.js | 11 | ||||
| -rw-r--r-- | routes/users.js | 32 |
2 files changed, 23 insertions, 20 deletions
diff --git a/routes/send.js b/routes/send.js index 0c93d0a2..7c6728a1 100644 --- a/routes/send.js +++ b/routes/send.js @@ -31,8 +31,7 @@ module.exports = ah(async (req, res, next) => { lock: transaction.LOCK.UPDATE, transaction }); - } - else { + } else { account = await db.Account.findOne({ where: { user_id: user.id, @@ -61,7 +60,9 @@ module.exports = ah(async (req, res, next) => { rate: app.get("rates")[user.currency], currency: user.currency, confirmed: true, - hash: `#${uuidv4().substr(0, 6)} ${(username ? `Payment to ${username}` : "Internal Transfer")}`, + hash: `#${uuidv4().substr(0, 6)} ${ + username ? `Payment to ${username}` : "Internal Transfer" + }`, network: "COINOS" }; @@ -99,7 +100,7 @@ module.exports = ah(async (req, res, next) => { }; if (address) params.where.address = address; else if (payreq) params.where.text = payreq; - let invoice = (address || payreq) && await db.Invoice.findOne(params); + let invoice = (address || payreq) && (await db.Invoice.findOne(params)); let a2; let acc = { @@ -164,7 +165,7 @@ module.exports = ah(async (req, res, next) => { rate: app.get("rates")[recipient.currency] * spread, currency: recipient.currency, confirmed: true, - hash: `#${uuidv4().substr(0,6)} Payment from ${user.username}`, + hash: `#${uuidv4().substr(0, 6)} Payment from ${user.username}`, memo, network: "COINOS", received: true diff --git a/routes/users.js b/routes/users.js index bcce9c14..56fdf31b 100644 --- a/routes/users.js +++ b/routes/users.js @@ -32,21 +32,23 @@ app.get( auth, ah(async (req, res) => { let user = req.user.get({ plain: true }); - let payments = await req.user.getPayments({ - where: { - account_id: user.account_id - }, - order: [["id", "DESC"]], - limit: 12, - include: [{ - model: db.Account, - as: "account" - }, - { - model: db.Payment, - as: "fee_payment" - }] - }); + let payments = await req.user.getPayments({ + where: { + account_id: user.account_id + }, + order: [["id", "DESC"]], + limit: 12, + include: [ + { + model: db.Account, + as: "account" + }, + { + model: db.Payment, + as: "fee_payment" + } + ] + }); user.accounts = await req.user.getAccounts(); user.payments = payments; res.send(user); |
