Просмотр исходного кода

Find page only public and not redirect

Sotaro KARASAWA 10 лет назад
Родитель
Сommit
93d1c48347
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      lib/models/page.js

+ 4 - 1
lib/models/page.js

@@ -424,6 +424,9 @@ module.exports = function(crowi) {
     });
   };
 
+  /**
+   * とりあえず、公開ページであり、redirectTo が無いものだけを出すためだけのAPI
+   */
   pageSchema.statics.findListByCreator = function(user, option) {
     var Page = this;
     var User = crowi.model('User');
@@ -432,7 +435,7 @@ module.exports = function(crowi) {
 
     return new Promise(function(resolve, reject) {
       Page
-        .find({ creator: user._id, grant: GRANT_PUBLIC })
+        .find({ creator: user._id, grant: GRANT_PUBLIC, redirectTo: null })
         .sort({createdAt: -1})
         .skip(offset)
         .limit(limit)