瀏覽代碼

validate for page id

ryuichi-e 6 年之前
父節點
當前提交
2b169f5364
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/server/routes/apiv3/share-links.js

+ 2 - 2
src/server/routes/apiv3/share-links.js

@@ -35,8 +35,8 @@ module.exports = (crowi) => {
   });
 
   validator.shareLinkStatus = [
-    // validate page id is not empty.
-    body('pageId').not().isEmpty(),
+    // validate the page id is null
+    body('pageId').not().isEmpty().withMessage('Page Id is null'),
 
     // validate expireation date is not empty, is not before today and is date.
     body('expiration').not().isEmpty().isBefore(today.toString),