|
@@ -82,7 +82,7 @@ export * from './page-service';
|
|
|
const logger = loggerFactory('growi:services:page');
|
|
const logger = loggerFactory('growi:services:page');
|
|
|
const {
|
|
const {
|
|
|
isTrashPage, isTopPage, omitDuplicateAreaPageFromPages, getUsernameByPath,
|
|
isTrashPage, isTopPage, omitDuplicateAreaPageFromPages, getUsernameByPath,
|
|
|
- canMoveByPath, isUsersTopPage, isMovablePage, isUsersHomepage, hasSlash, generateChildrenRegExp,
|
|
|
|
|
|
|
+ isUsersTopPage, isMovablePage, isUsersHomepage, hasSlash, generateChildrenRegExp,
|
|
|
} = pagePathUtils;
|
|
} = pagePathUtils;
|
|
|
|
|
|
|
|
const { addTrailingSlash } = pathUtils;
|
|
const { addTrailingSlash } = pathUtils;
|
|
@@ -551,16 +551,6 @@ class PageService implements IPageService {
|
|
|
return this.renamePageV4(page, newPagePath, user, options);
|
|
return this.renamePageV4(page, newPagePath, user, options);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (options.isMoveMode) {
|
|
|
|
|
- const fromPath = page.path;
|
|
|
|
|
- const toPath = newPagePath;
|
|
|
|
|
- const canMove = canMoveByPath(fromPath, toPath) && await Page.exists({ path: newPagePath });
|
|
|
|
|
-
|
|
|
|
|
- if (!canMove) {
|
|
|
|
|
- throw Error('Cannot move to this path.');
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
const canOperate = await this.crowi.pageOperationService.canOperate(true, page.path, newPagePath);
|
|
const canOperate = await this.crowi.pageOperationService.canOperate(true, page.path, newPagePath);
|
|
|
if (!canOperate) {
|
|
if (!canOperate) {
|
|
|
throw Error(`Cannot operate rename to path "${newPagePath}" right now.`);
|
|
throw Error(`Cannot operate rename to path "${newPagePath}" right now.`);
|