소스 검색

Fixed code to use req.user

Taichi Masuyama 4 년 전
부모
커밋
c24d586357
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      packages/app/src/server/routes/apiv3/pages.js

+ 1 - 3
packages/app/src/server/routes/apiv3/pages.js

@@ -791,9 +791,7 @@ module.exports = (crowi) => {
     if (convertPath != null) {
       const normalizedPath = pathUtils.normalizePath(convertPath);
       try {
-        // await crowi.pageService.normalizeParentByPath(normalizedPath, req.user);
-        const User = mongoose.model('User');
-        await crowi.pageService.normalizeParentByPath(normalizedPath, await User.findOne());
+        await crowi.pageService.normalizeParentByPath(normalizedPath, req.user);
       }
       catch (err) {
         logger.error(err);