mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
Fixed expiry filter breaking with only 1 date
This commit is contained in:
parent
575a9353fa
commit
93ee4dae05
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user