1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00

Fix typo in custom validator

This commit is contained in:
ivaosthu 2017-11-16 16:07:27 +01:00
parent 9fdb948c69
commit 8c02cc4949
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ const validator = require('express-validator');
module.exports = function() {
return validator({
customValidators: {
isUrlFirendlyName: input => encodeURIComponent(input) === input,
isUrlFriendlyName: input => encodeURIComponent(input) === input,
},
});
};

View File

@ -108,7 +108,7 @@ module.exports.router = function(config) {
router.post('/validate', (req, res) => {
req.checkBody('name', 'Name is required').notEmpty();
req.checkBody('name', 'Name must be URL friendly').isUrlFirendlyName();
req.checkBody('name', 'Name must be URL friendly').isUrlFriendlyName();
validateRequest(req)
.then(validateUniqueName)
@ -118,7 +118,7 @@ module.exports.router = function(config) {
router.post('/', (req, res) => {
req.checkBody('name', 'Name is required').notEmpty();
req.checkBody('name', 'Name must be URL friendly').isUrlFirendlyName();
req.checkBody('name', 'Name must be URL friendly').isUrlFriendlyName();
const userName = extractUser(req);