Procházet zdrojové kódy

validate for expireation

ryuichi-e před 5 roky
rodič
revize
2f6892c44c
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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 }),