Skip to content

Instantly share code, notes, and snippets.

@xtrinch
Created September 3, 2018 16:19
Show Gist options
  • Save xtrinch/98ca781b28ff4823bed1e385a90f9d1c to your computer and use it in GitHub Desktop.
Save xtrinch/98ca781b28ff4823bed1e385a90f9d1c to your computer and use it in GitHub Desktop.
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