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

force to delete trashed pages completely

sou 7 лет назад
Родитель
Сommit
b2d66d6079
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      lib/routes/page.js

+ 6 - 1
lib/routes/page.js

@@ -1081,12 +1081,17 @@ module.exports = function(crowi, app) {
     var previousRevision = req.body.revision_id || null;
 
     // get completely flag
-    const isCompletely = (req.body.completely !== undefined);
+    let isCompletely = (req.body.completely !== undefined);
     // get recursively flag
     const isRecursively = (req.body.recursively !== undefined);
 
     Page.findPageByIdAndGrantedUser(pageId, req.user)
       .then(function(pageData) {
+        const isTrashed = pageData.path.search(/^\/trash/) !== -1;
+        if (isTrashed) {
+          isCompletely = true;
+        }
+
         debug('Delete page', pageData._id, pageData.path);
 
         if (isCompletely) {