diff options
Diffstat (limited to 'bucky/app/bucky.js')
| -rw-r--r-- | bucky/app/bucky.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bucky/app/bucky.js b/bucky/app/bucky.js index 47eb7e1..b331688 100644 --- a/bucky/app/bucky.js +++ b/bucky/app/bucky.js @@ -592,8 +592,11 @@ var bucky = module.exports = { }) }, ensureMessages: function (req, res, next){ - db.getMessages(req.user.get('username'), req.params.box, 50, 0).then(function(messages){ + const limit = parseInt(req.query.limit) || 50 + const offset = parseInt(req.query.offset) || 0 + db.getMessages(req.user.get('username'), req.params.box, limit, offset).then(function(messages){ res.messages = messages + res.query = { limit, offset } next() }) }, |
