Parcourir la source

fix errorcode 409

zahmis il y a 5 ans
Parent
commit
73defc58f9
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/server/routes/apiv3/pages.js

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

@@ -192,7 +192,7 @@ module.exports = (crowi) => {
     const isExist = (await Page.count(req.body.path)) > 0;
     if (isExist) {
       res.code = 'page_exists';
-      return res.apiv3Err(new ErrorV3('This page is already exist.', 'already_exists'));
+      return res.apiv3Err(new ErrorV3('This page is already exist.', 'already_exists'), 409);
     }
 
     const createdPage = await Page.create(req.body.path, req.body.body, req.user);