Removed redundant req.assert for empty email
Swapped code order of a few things in app.js to make it more consistent in terms of coding style
This commit is contained in:
13
app.js
13
app.js
@ -11,12 +11,6 @@ var mongoose = require('mongoose');
|
|||||||
var passport = require('passport');
|
var passport = require('passport');
|
||||||
var expressValidator = require('express-validator');
|
var expressValidator = require('express-validator');
|
||||||
|
|
||||||
/**
|
|
||||||
* Create Express server.
|
|
||||||
*/
|
|
||||||
|
|
||||||
var app = express();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load controllers.
|
* Load controllers.
|
||||||
*/
|
*/
|
||||||
@ -33,6 +27,13 @@ var contactController = require('./controllers/contact');
|
|||||||
var secrets = require('./config/secrets');
|
var secrets = require('./config/secrets');
|
||||||
var passportConf = require('./config/passport');
|
var passportConf = require('./config/passport');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create Express server.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var app = express();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mongoose configuration.
|
* Mongoose configuration.
|
||||||
*/
|
*/
|
||||||
|
@ -22,7 +22,6 @@ exports.getContact = function(req, res) {
|
|||||||
|
|
||||||
exports.postContact = function(req, res) {
|
exports.postContact = function(req, res) {
|
||||||
req.assert('name', 'Name cannot be blank').notEmpty();
|
req.assert('name', 'Name cannot be blank').notEmpty();
|
||||||
req.assert('email', 'Email cannot be blank').notEmpty();
|
|
||||||
req.assert('email', 'Email is not valid').isEmail();
|
req.assert('email', 'Email is not valid').isEmail();
|
||||||
req.assert('message', 'Message cannot be blank').notEmpty();
|
req.assert('message', 'Message cannot be blank').notEmpty();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user