ryuichi-e 5 лет назад
Родитель
Сommit
b40d501c8a
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      src/server/routes/apiv3/share-links.js

+ 11 - 0
src/server/routes/apiv3/share-links.js

@@ -34,6 +34,17 @@ module.exports = (crowi) => {
     // TODO GW-2616 get all share links associated with the page
     // TODO GW-2616 get all share links associated with the page
   });
   });
 
 
+  validator.shareLinkStatus = [
+    // validate page id is not empty.
+    body('pageId').not().isEmpty(),
+
+    // validate expireation date is not empty, is not before today and is date.
+    body('expiration').not().isEmpty().isBefore(today.toString),
+
+    // validate the length of description is max 100.
+    body('description').isLength({ min: 0, max: 100 }),
+  ];
+
   /**
   /**
    * @swagger
    * @swagger
    *
    *