aboutsummaryrefslogtreecommitdiffstats
path: root/routes/invoices.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-08-01 22:17:58 -0700
committerAdam Soltys <[email protected]>2022-08-01 22:17:58 -0700
commit99b7b4fbeb64e2e4512211c9c2a4a085bacd96d8 (patch)
treeb2b6b97328cb9ea4b86d7b32e89aa805af29b04b /routes/invoices.js
parent82f9acc60b7edbdfee96f1553d0fb1dcc705b866 (diff)
downloadcoinos-server-99b7b4fbeb64e2e4512211c9c2a4a085bacd96d8.tar.gz
coinos-server-99b7b4fbeb64e2e4512211c9c2a4a085bacd96d8.zip
record invoice status
Diffstat (limited to 'routes/invoices.js')
-rw-r--r--routes/invoices.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/routes/invoices.js b/routes/invoices.js
index 1208e14e..b5650735 100644
--- a/routes/invoices.js
+++ b/routes/invoices.js
@@ -8,7 +8,12 @@ app.get(
const invoice = await db.Invoice.findOne({
where: {
uuid: req.query.uuid
- }
+ },
+ include: {
+ model: db.User,
+ as: "user",
+ attributes: ['username']
+ }
});
res.send(invoice);
@@ -23,7 +28,7 @@ app.post(
optionalAuth,
ah(async (req, res, next) => {
try {
- let { liquidAddress, invoice, user, tx } = req.body;
+ let { liquidAddress, id, invoice, user, tx } = req.body;
let { blindkey } = invoice;
if (invoice.amount < 0) throw new Error("amount out of range");