소스 검색

fix isExist

zahmis 5 년 전
부모
커밋
cb4698a894
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/server/routes/apiv3/pages.js

+ 1 - 1
src/server/routes/apiv3/pages.js

@@ -191,7 +191,7 @@ module.exports = (crowi) => {
 
 
     // check page existence
-    const isExist = (await Page.count(req.body.path)) > 0;
+    const isExist = (await Page.count({ path: req.body.path })) > 0;
     if (isExist) {
       res.code = 'page_exists';
       return res.apiv3Err(new ErrorV3('Page exists', 'already_exists'), 409);