controllers/AccountController.js
function(req, res, next) {
      var accData = req.user.Account
        , newData = {
          name:       req.body.name       || accData.name,
          logo:       req.body.logo       || accData.logo,
          info:       req.body.info       || accData.info,
          email:      req.body.email      || accData.email,
          themeColor: req.body.themeColor || accData.themeColor
        };

      req.body = newData;
      next();
    }
function(req, res, next) {
      var accData = req.user.Account
        , newData = {
          name:       req.body.name       || accData.name,
          logo:       req.body.logo       || accData.logo,
          info:       req.body.info       || accData.info,
          email:      req.body.email      || accData.email,
          themeColor: req.body.themeColor || accData.themeColor
        };

      req.body = newData;
      next();
    }
function ( req , res , next ) { var accData = req . user . Account , newData = { name : req . body . name || accData . name , logo : req . body . logo || accData . logo , info : req . body . info || accData . info , email : req . body . email || accData . email , themeColor : req . body . themeColor || accData . themeColor } ; req . body = newData ; next ( ) ; }
Middleware helper function to format data in POST or PUT requests

@param  {Request}  req  The Request Object
@param  {Response} res  The response object
@param  {Function} next Continue past this middleware
@return {void}
Middleware helper function to format data in POST or PUT requests