Explorar el Código

validate for expireation

ryuichi-e hace 5 años
padre
commit
2f6892c44c
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/server/routes/apiv3/share-links.js

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

@@ -39,7 +39,7 @@ module.exports = (crowi) => {
     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),
+    body('expiration').isAfter(today.toString()).withMessage('Your Selected date is past'),
 
     // validate the length of description is max 100.
     body('description').isLength({ min: 0, max: 100 }),