From 93ee4dae050d3872e95334b787d6250fa2975c28 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Sun, 17 May 2020 23:43:08 +0700 Subject: [PATCH] Fixed expiry filter breaking with only 1 date --- controllers/uploadController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/uploadController.js b/controllers/uploadController.js index cf1d73e..e7c26d8 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -1180,9 +1180,9 @@ self.list = async (req, res) => { if (typeof filterObj.queries.expiry.to === 'number') this.andWhereBetween('expirydate', [filterObj.queries.expiry.from, filterObj.queries.expiry.to]) else - this.andWhere('expirydate', '>=', filterObj.queries.date.from) + this.andWhere('expirydate', '>=', filterObj.queries.expiry.from) else - this.andWhere('expirydate', '<=', filterObj.queries.date.to) + this.andWhere('expirydate', '<=', filterObj.queries.expiry.to) }) // Then, refine using type-is flags