Created
September 3, 2018 16:19
-
-
Save xtrinch/98ca781b28ff4823bed1e385a90f9d1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
attributes: { | |
title: { | |
type: 'string', | |
required: true | |
}, | |
description: { | |
type: 'string', | |
required: true | |
}, | |
}, | |
validate: (req) => { | |
req.check('title') | |
.exists() | |
.isLength({ min: 1 }).withMessage('must be at least 5 chars long'); | |
req.check('description').exists(); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment