diff options
| author | Adam Soltys <[email protected]> | 2020-05-13 15:45:11 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-05-13 15:45:11 -0700 |
| commit | 5ca6307dda36fc11d43995c4a88f49a1a4b2e90c (patch) | |
| tree | bc3587def1ac881e8abae89864ce351cff8d3f8d /routes/lightning/query.js | |
| parent | 816bfa54afd50059d781a9da5dc953611b9fdc66 (diff) | |
| download | coinos-server-5ca6307dda36fc11d43995c4a88f49a1a4b2e90c.tar.gz coinos-server-5ca6307dda36fc11d43995c4a88f49a1a4b2e90c.zip | |
get lightning recipient
Diffstat (limited to 'routes/lightning/query.js')
| -rw-r--r-- | routes/lightning/query.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/routes/lightning/query.js b/routes/lightning/query.js new file mode 100644 index 00000000..012f20f4 --- /dev/null +++ b/routes/lightning/query.js @@ -0,0 +1,15 @@ +module.exports = async (req, res) => { + const { payreq } = req.body; + + const invoice = await db.Invoice.findOne({ + include: { + model: db.User, + as: "user" + }, + where: { + text: payreq, + } + }); + + if (invoice) emit(req.user.username, "to", invoice.user); +}; |
