diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js index e3b14b3a2a..4926ad88f2 100644 --- a/modules/entry/back/methods/entry/filter.js +++ b/modules/entry/back/methods/entry/filter.js @@ -233,7 +233,7 @@ module.exports = Self => { params: [ctx.args.daysBefore] }); } - stmt.merge({sql: ')'}); + if (ctx.args.daysAfter) stmt.merge({sql: ')'}); stmt.merge(conn.makeSuffix(filter)); const itemsIndex = stmts.push(stmt) - 1; diff --git a/modules/entry/back/methods/entry/specs/filter.spec.js b/modules/entry/back/methods/entry/specs/filter.spec.js index c7156062a9..9007deeeff 100644 --- a/modules/entry/back/methods/entry/specs/filter.spec.js +++ b/modules/entry/back/methods/entry/specs/filter.spec.js @@ -55,7 +55,7 @@ describe('Entry filter()', () => { try { const ctx = { - args: {days: 6}, + args: {daysAfter: 6}, req: {accessToken: {userId: 1102}} };