aboutsummaryrefslogtreecommitdiffstats
path: root/sendPayment.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-01-06 13:36:58 -0800
committerAdam Soltys <[email protected]>2020-01-06 13:36:58 -0800
commitbf6c5ff5a7b3bba840ae024312e721fedb488bce (patch)
tree8acee30af13d15982ced493d2b1fb220f6d7b198 /sendPayment.js
parent25cb911ae245be1956cee922e4ef62f656303907 (diff)
downloadcoinos-server-bf6c5ff5a7b3bba840ae024312e721fedb488bce.tar.gz
coinos-server-bf6c5ff5a7b3bba840ae024312e721fedb488bce.zip
emit on payment send
Diffstat (limited to 'sendPayment.js')
-rw-r--r--sendPayment.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/sendPayment.js b/sendPayment.js
index c5ce7ea3..2450e6bc 100644
--- a/sendPayment.js
+++ b/sendPayment.js
@@ -50,7 +50,7 @@ module.exports = (app, db, emit, seen, lna, lnb) => async (req, res) => {
await db.transaction(async transaction => {
await req.user.save({ transaction });
- await db.Payment.create(
+ const payment = await db.Payment.create(
{
amount: -total,
user_id: req.user.id,
@@ -61,6 +61,8 @@ module.exports = (app, db, emit, seen, lna, lnb) => async (req, res) => {
},
{ transaction }
);
+
+ emit(req.user.username, "payment", payment);
});
emit(req.user.username, "user", req.user);