aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/payments.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 7cb51d02..0e829029 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -1,5 +1,6 @@
const BitcoinCore = require("bitcoin-core");
const lnd = require("../lib/lnd");
+const { Op } = require("sequelize");
(async () => {
bc = new BitcoinCore(config.bitcoin);
@@ -37,7 +38,15 @@ const lnd = require("../lib/lnd");
app.get("/payments", auth, async (req, res) => {
const payments = await db.Payment.findAll({
- where: { user_id: req.user.id },
+ where: {
+ user_id: req.user.id,
+ [Op.or]: {
+ received: true,
+ amount: {
+ [Op.lt]: 0,
+ },
+ },
+ },
order: [["id", "DESC"]]
});