aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-11-01 18:56:34 +0000
committerAdam Soltys <[email protected]>2022-11-01 18:56:34 +0000
commite31957e3030a8d402a38062476915b4416aa8507 (patch)
treef9e2ecfc85f24dd718b2fa11e85a45e1e64590f3
parent5826161d6835beef147b604a99285dd44f2aa7f3 (diff)
downloadcoinos-server-e31957e3030a8d402a38062476915b4416aa8507.tar.gz
coinos-server-e31957e3030a8d402a38062476915b4416aa8507.zip
fix payments query
-rw-r--r--routes/payments.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 678b646c..d60d4e2e 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -108,9 +108,9 @@ app.get("/payments", auth, async (req, res) => {
let where = {
account_id: req.user.account_id,
- createdAt: {}
};
+ if (start || end) where.createdAt = {};
if (start) where.createdAt[Op.gte] = new Date(parseInt(start));
if (end) where.createdAt[Op.lte] = new Date(parseInt(end));