2
0
Эх сурвалжийг харах

Find page only public and not redirect

Sotaro KARASAWA 10 жил өмнө
parent
commit
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)