Преглед изворни кода

handle empty page
- Include isEmpty page to handle _notFound in redirector

NEEDLEMAN3\tatsu пре 4 година
родитељ
комит
7f5649dc1c
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      packages/app/src/server/routes/page.js

+ 2 - 1
packages/app/src/server/routes/page.js

@@ -614,7 +614,8 @@ module.exports = function(crowi, app) {
   async function redirector(req, res, next, path) {
     const { redirectFrom } = req.query;
 
-    const builder = new PageQueryBuilder(Page.find({ path }));
+    // Include isEmpty page to handle _notFound
+    const builder = new PageQueryBuilder(Page.find({ path }), true);
     await Page.addConditionToFilteringByViewerForList(builder, req.user);
 
     const pages = await builder.query.lean().clone().exec('find');