diff --git a/routes/profiles.js b/routes/profiles.js index 1917c20..6e360c3 100644 --- a/routes/profiles.js +++ b/routes/profiles.js @@ -161,15 +161,15 @@ Router.route('/list' + ParamStr) find: find, select: '_id order details.name details.pics.thumbnail', options: { - limit: 0, - skip: 0, + limit: !isNaN(parseInt(req.params.limit)) ? parseInt(req.params.limit) : 0, + skip: !isNaN(parseInt(req.params.skip)) ? parseInt(req.params.skip) : 0, sort: { 'order': 1 } } }; ProfileEvents.once('find', (err, result) => { if (err) { - res.status(500).json({ message: 'There was an error getting the vendor list', err: err }); + res.status(500).json({ message: 'There was an error getting the profile list [' + err + ']', err: err }); } if (result) {