Explorar o código

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

NEEDLEMAN3\tatsu %!s(int64=4) %!d(string=hai) anos
pai
achega
7f5649dc1c
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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');