|
|
@@ -278,11 +278,11 @@ module.exports = function(crowi, app) {
|
|
|
renderVars.isNotFoundPermalink = !isPath && !await Page.exists({ _id: pathOrId });
|
|
|
}
|
|
|
|
|
|
- async function addRenderVarsWhenEmptyPage(renderVars, emptyPagePermalink) {
|
|
|
- if (emptyPagePermalink == null) {
|
|
|
+ async function addRenderVarsWhenEmptyPage(renderVars, emptyPageId) {
|
|
|
+ if (emptyPageId == null) {
|
|
|
return;
|
|
|
}
|
|
|
- renderVars.emptyPagePermalink = emptyPagePermalink;
|
|
|
+ renderVars.emptyPageId = emptyPageId;
|
|
|
}
|
|
|
|
|
|
function replacePlaceholdersOfTemplate(template, req) {
|
|
|
@@ -340,9 +340,8 @@ module.exports = function(crowi, app) {
|
|
|
await addRenderVarsForDescendants(renderVars, path, req.user, offset, limit, true);
|
|
|
await addRenderVarsForPageTree(renderVars, pathOrId, req.user);
|
|
|
await addRenderVarsWhenNotFound(renderVars, pathOrId);
|
|
|
- if (req.emptyPagePermalink != null) {
|
|
|
- // isEmpty かどうかをフロントに伝える
|
|
|
- await addRenderVarsWhenEmptyPage(renderVars, req.emptyPagePermalink);
|
|
|
+ if (req.emptyPageId != null) {
|
|
|
+ await addRenderVarsWhenEmptyPage(renderVars, req.emptyPageId);
|
|
|
}
|
|
|
return res.render(view, renderVars);
|
|
|
}
|
|
|
@@ -660,7 +659,7 @@ module.exports = function(crowi, app) {
|
|
|
return _notFound(req, res);
|
|
|
}
|
|
|
if (isEmptyPage) {
|
|
|
- req.emptyPagePermalink = pages[0]._id;
|
|
|
+ req.emptyPageId = pages[0]._id;
|
|
|
return _notFound(req, res);
|
|
|
}
|
|
|
|