|
|
@@ -1161,7 +1161,7 @@ module.exports = function(crowi, app) {
|
|
|
|
|
|
const options = {};
|
|
|
|
|
|
- const page = await Page.findByIdAndViewerToEdit(pageId, req.user);
|
|
|
+ const page = await Page.findByIdAndViewerToEdit(pageId, req.user, true);
|
|
|
|
|
|
if (page == null) {
|
|
|
return res.json(ApiResponse.error(`Page '${pageId}' is not found or forbidden`, 'notfound_or_forbidden'));
|
|
|
@@ -1177,7 +1177,7 @@ module.exports = function(crowi, app) {
|
|
|
await crowi.pageService.deleteCompletely(page, req.user, options, isRecursively);
|
|
|
}
|
|
|
else {
|
|
|
- if (!page.isUpdatable(previousRevision)) {
|
|
|
+ if (!page.isEmpty && !page.isUpdatable(previousRevision)) {
|
|
|
return res.json(ApiResponse.error('Someone could update this page, so couldn\'t delete.', 'outdated'));
|
|
|
}
|
|
|
|