|
@@ -1061,11 +1061,12 @@ module.exports = function(crowi) {
|
|
|
const newPath = this.getDeletedPageName(pageData.path);
|
|
const newPath = this.getDeletedPageName(pageData.path);
|
|
|
const isTrashed = checkIfTrashed(pageData.path);
|
|
const isTrashed = checkIfTrashed(pageData.path);
|
|
|
|
|
|
|
|
|
|
+ if (isTrashed) {
|
|
|
|
|
+ throw new Error('This method does NOT support deleting trashed pages.');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const socketClientId = options.socketClientId || null;
|
|
const socketClientId = options.socketClientId || null;
|
|
|
if (this.isDeletableName(pageData.path)) {
|
|
if (this.isDeletableName(pageData.path)) {
|
|
|
- if (isTrashed) {
|
|
|
|
|
- return this.completelyDeletePage(pageData, user, options);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
pageData.status = STATUS_DELETED;
|
|
pageData.status = STATUS_DELETED;
|
|
|
const updatedPageData = await this.rename(pageData, newPath, user, { socketClientId, createRedirectPage: true });
|
|
const updatedPageData = await this.rename(pageData, newPath, user, { socketClientId, createRedirectPage: true });
|
|
@@ -1084,7 +1085,7 @@ module.exports = function(crowi) {
|
|
|
const isTrashed = checkIfTrashed(targetPage.path);
|
|
const isTrashed = checkIfTrashed(targetPage.path);
|
|
|
|
|
|
|
|
if (isTrashed) {
|
|
if (isTrashed) {
|
|
|
- return this.completelyDeletePageRecursively(targetPage, user, options);
|
|
|
|
|
|
|
+ throw new Error('This method does NOT supports deleting trashed pages.');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const findOpts = { includeRedirect: true };
|
|
const findOpts = { includeRedirect: true };
|