function parseCreateAlertRequest(req){

  var reqObj = {};
  reqObj.originalUrl = req.originalUrl;
  reqObj.alertName = req.body.alertName;
  reqObj.emails = req.body.emails;
  reqObj.eventCategories = req.body.eventCategories.split(',');
  reqObj.eventNames = req.body.eventNames.split(',');
  reqObj.eventSeverities = req.body.eventSeverities.split(',');
  reqObj.uid = req.body.uid;
  reqObj.env = req.body.env;
  reqObj.alertEnabled = req.body.enabled;
  reqObj._id = new Mongoose.Types.ObjectId();
  reqObj.domain = req.params.domain;
  return reqObj;
}
function parseCreateAlertRequest(req){

  var reqObj = {};
  reqObj.originalUrl = req.originalUrl;
  reqObj.alertName = req.body.alertName;
  reqObj.emails = req.body.emails;
  reqObj.eventCategories = req.body.eventCategories.split(',');
  reqObj.eventNames = req.body.eventNames.split(',');
  reqObj.eventSeverities = req.body.eventSeverities.split(',');
  reqObj.uid = req.body.uid;
  reqObj.env = req.body.env;
  reqObj.alertEnabled = req.body.enabled;
  reqObj._id = new Mongoose.Types.ObjectId();
  reqObj.domain = req.params.domain;
  return reqObj;
}
function parseCreateAlertRequest ( req ) { var reqObj = { } ; reqObj . originalUrl = req . originalUrl ; reqObj . alertName = req . body . alertName ; reqObj . emails = req . body . emails ; reqObj . eventCategories = req . body . eventCategories . split ( ',' ) ; reqObj . eventNames = req . body . eventNames . split ( ',' ) ; reqObj . eventSeverities = req . body . eventSeverities . split ( ',' ) ; reqObj . uid = req . body . uid ; reqObj . env = req . body . env ; reqObj . alertEnabled = req . body . enabled ; reqObj . _id = new Mongoose . Types . ObjectId ( ) ; reqObj . domain = req . params . domain ; return reqObj ; }
Parse the incoming Create Alert Request into a common object
Parse the incoming Create Alert Request into a common object