lib/impl/dataTargets.js
function validateDataTarget(connections, dataTarget, cb) {
  var DataTarget = models.get(connections.mongooseConnection, models.MODELNAMES.DATA_TARGET);
  var testDataTarget = new DataTarget(dataTarget);
  //Validating Without Saving
  testDataTarget.validate(function(err) {
    if (err) {
      return cb(buildErrorResponse({
        error: err,
        userDetail: "Invalid Data Target Creation Data.",
        systemDetail: err.errors,
        code: ERROR_CODES.FH_FORMS_INVALID_PARAMETERS
      }));
    }

    return cb(undefined, dataTarget);
  });
}
function validateDataTarget(connections, dataTarget, cb) {
  var DataTarget = models.get(connections.mongooseConnection, models.MODELNAMES.DATA_TARGET);
  var testDataTarget = new DataTarget(dataTarget);
  //Validating Without Saving
  testDataTarget.validate(function(err) {
    if (err) {
      return cb(buildErrorResponse({
        error: err,
        userDetail: "Invalid Data Target Creation Data.",
        systemDetail: err.errors,
        code: ERROR_CODES.FH_FORMS_INVALID_PARAMETERS
      }));
    }

    return cb(undefined, dataTarget);
  });
}
function validateDataTarget ( connections , dataTarget , cb ) { var DataTarget = models . get ( connections . mongooseConnection , models . MODELNAMES . DATA_TARGET ) ; var testDataTarget = new DataTarget ( dataTarget ) ; //Validating Without Saving testDataTarget . validate ( function ( err ) { if ( err ) { return cb ( buildErrorResponse ( { error : err , userDetail : "Invalid Data Target Creation Data." , systemDetail : err . errors , code : ERROR_CODES . FH_FORMS_INVALID_PARAMETERS } ) ) ; } return cb ( undefined , dataTarget ) ; } ) ; }
Validating A Data Target Object.
@param connections
@param dataTarget
@param cb
Validating A Data Target Object .