|
|
@@ -64,10 +64,8 @@ module.exports = (crowi) => {
|
|
|
validator.shareLinkStatus = [
|
|
|
// validate the page id is null
|
|
|
body('relatedPage').not().isEmpty().withMessage('Page Id is null'),
|
|
|
-
|
|
|
// validate expireation date is not empty, is not before today and is date.
|
|
|
- body('expiredAt').isAfter(today.toString()).withMessage('Your Selected date is past'),
|
|
|
-
|
|
|
+ body('expiredAt').if(value => value != null).isAfter(today.toString()).withMessage('Your Selected date is past'),
|
|
|
// validate the length of description is max 100.
|
|
|
body('description').isLength({ min: 0, max: 100 }).withMessage('Max length is 100'),
|
|
|
|