Procházet zdrojové kódy

Fix for current spec of mongoose-paginate

Sotaro KARASAWA před 10 roky
rodič
revize
71ae5dc6fe
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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);