Răsfoiți Sursa

Fixed code to use req.user

Taichi Masuyama 4 ani în urmă
părinte
comite
c24d586357
1 a modificat fișierele cu 1 adăugiri și 3 ștergeri
  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);