diff options
| -rw-r--r-- | routes/payments.js | 2 |
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)); |
