Преглед изворни кода

Fix for current spec of mongoose-paginate

Sotaro KARASAWA пре 10 година
родитељ
комит
71ae5dc6fe
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lib/models/user.js

+ 1 - 1
lib/models/user.js

@@ -254,7 +254,7 @@ module.exports = function(crowi) {
   userSchema.statics.findUsersWithPagination = function(options, callback) {
     var sort = options.sort || {status: 1, username: 1, createdAt: 1};
 
-    this.paginate({}, options.page || 1, PAGE_ITEMS, function(err, pageCount, paginatedResults, itemCount) {
+    this.paginate({}, { page: options.page || 1, limit: PAGE_ITEMS }, function(err, paginatedResults, pageCount, itemCount) {
       if (err) {
         debug('Error on pagination:', err);
         return callback(err, null);