aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sockets.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/sockets.js b/lib/sockets.js
index d7973a99..f35ca5f5 100644
--- a/lib/sockets.js
+++ b/lib/sockets.js
@@ -1,6 +1,6 @@
const jwt = require("jsonwebtoken");
const io = require("socket.io");
-const Sequelize = require("sequelize");
+const { Op } = require("sequelize");
/* eslint-disable-next-line */
const pick = (O, ...K) => K.reduce((o, k) => ((o[k] = O[k]), o), {});
@@ -44,8 +44,13 @@ socket.sockets.on("connect", async socket => {
model: db.Payment,
as: "payments",
order: [["id", "DESC"]],
- received: {
- [Sequelize.Op.ne]: null
+ where: {
+ [Op.or]: {
+ received: true,
+ amount: {
+ [Op.lt]: 0,
+ },
+ },
},
limit: 12
}