aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sockets.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-03-26 10:19:58 -0700
committerAdam Soltys <[email protected]>2020-03-26 10:19:58 -0700
commitb75a06ea0dadcb7ad2416e900e15276661e065be (patch)
tree873b67947303a64acfaa018900b590651331928b /lib/sockets.js
parent4eee705620cb0a7626d9d000d4c78c4691784bff (diff)
downloadcoinos-server-b75a06ea0dadcb7ad2416e900e15276661e065be.tar.gz
coinos-server-b75a06ea0dadcb7ad2416e900e15276661e065be.zip
filter payments
Diffstat (limited to 'lib/sockets.js')
-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
}