|
|
@@ -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) {
|