edwardhotchkiss / mongoose-paginate

Mongoose.js (Node.js & MongoDB) Document Query Pagination
MIT License
984 stars 216 forks source link

Duplicated 'data.results' argument on the callback #42

Closed josepramon closed 9 years ago

josepramon commented 9 years ago

On version 3.1.5, the data.results is passed twice on the callback.

The line:

callback(null, data.results, Math.ceil(data.count / resultsPerPage) || 1, data.results, data.count);

should be:

callback(null, data.results, Math.ceil(data.count / resultsPerPage) || 1, data.count);
freezy commented 9 years ago

Same issue here, all tests red ;)

hustKiwi commented 9 years ago

@niftylettuce

niftylettuce commented 9 years ago

I'll look. On Jul 2, 2015 2:12 PM, "Honchar Denys" notifications@github.com wrote:

+1, lets check source code and fix that, probably easy fix

— Reply to this email directly or view it on GitHub https://github.com/edwardhotchkiss/mongoose-paginate/issues/42#issuecomment-118113776 .

niftylettuce commented 9 years ago

Fixed and released v3.1.6 to NPM. Thank you so much @josepramon @freezy

freezy commented 9 years ago

Everything back green. Cheers mate!