yohei0125 4 سال پیش
والد
کامیت
d99d17fdd7
2فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 1 1
      packages/app/src/server/models/obsolete-page.js
  2. 1 0
      packages/app/src/server/routes/page.js

+ 1 - 1
packages/app/src/server/models/obsolete-page.js

@@ -420,7 +420,7 @@ export const getPageSchema = (crowi) => {
   };
   };
 
 
   /**
   /**
-   * find pages that is match with `path` and its descendants whitch user is able to manage
+   * find pages that is match with `path` and its descendants which user is able to manage
    */
    */
   pageSchema.statics.findManageableListWithDescendants = async function(page, user, option = {}, includeEmpty = false) {
   pageSchema.statics.findManageableListWithDescendants = async function(page, user, option = {}, includeEmpty = false) {
     if (user == null) {
     if (user == null) {

+ 1 - 0
packages/app/src/server/routes/page.js

@@ -613,6 +613,7 @@ module.exports = function(crowi, app) {
     const pages = await builder.query.lean().clone().exec('find');
     const pages = await builder.query.lean().clone().exec('find');
 
 
     if (pages.length >= 2) {
     if (pages.length >= 2) {
+      // Todo: remove empty pages if any. Immediately return if count of remaining pages are less than 2 after removal
 
 
       // populate to list
       // populate to list
       builder.populateDataToList(User.USER_FIELDS_EXCEPT_CONFIDENTIAL);
       builder.populateDataToList(User.USER_FIELDS_EXCEPT_CONFIDENTIAL);