• app.jsxのcomponentMappings

src/server/routes

pages.js
async function addRenderVarsForDescendants(renderVars, path, requestUser, offset, limit, isRegExpEscapedFromPath) { const SEENER_THRESHOLD = 10; const queryOptions = { offset, limit, includeTrashed: path.startsWith('/trash/'), isRegExpEscapedFromPath, };
  • swig でレンダリングする場合はここで設定されている
  • APIv3 でも同じようにする必要がある

そのページがTrashかどうか

Screen Shot 2020-10-14 at 19.13.37.png

修正

const { isTrashPage } = require('@commons/util/path-utils');
node.jsではrequireメソッドを使用して特定のパスを追加する感じですね。

apiv3配下のpages.js

pages.js
router.get('/list', accessTokenParser, loginRequired, async(req, res) => { const { path } = req.query; const limit = +req.query.limit || 30; const offset = +req.query.offset || 0; const { isTrashPage } = require('@commons/util/path-utils'); let includeTrashed; if (isTrashPage) { includeTrashed = true; } else { includeTrashed = false; } const queryOptions = { offset, limit, includeTrashed }; try { const result = await Page.findListWithDescendants(path, req.user, queryOptions); return res.apiv3(result); } catch (err) { logger.error('Failed to get Descendants Pages', err); return res.apiv3Err(err, 500); } });