lib/middleware/forms.js
function notifySubmissionComplete(req, res, next){
  req.appformsResultPayload = req.appformsResultPayload || {};
  var completeStatus = req.appformsResultPayload.data;
  var submission = completeStatus.formSubmission;

  //The Submission Is Not Complete, No need to send a notification.
  if("complete" !== completeStatus.status){
    return next();
  }

  var resourcePath = "/api/v2/appforms/domain/:domain/projects/:projectid/apps/:guid/forms/" + submission.formId + "/submissions/" + req.params.id + "/complete";

  var params = _createRequestParams(_.extend({
    resourcePath: resourcePath,
    method: "POST",
    apiKey: req.get('x-fh-auth-app'),
    appMbaasModel: req.appMbaasModel,
    data: completeStatus
  }, req.params));

  log.logger.debug("notifySubmissionComplete ", {params: params});

  request(params, _createResponseHandler(req, next, true));
}
function notifySubmissionComplete(req, res, next){
  req.appformsResultPayload = req.appformsResultPayload || {};
  var completeStatus = req.appformsResultPayload.data;
  var submission = completeStatus.formSubmission;

  //The Submission Is Not Complete, No need to send a notification.
  if("complete" !== completeStatus.status){
    return next();
  }

  var resourcePath = "/api/v2/appforms/domain/:domain/projects/:projectid/apps/:guid/forms/" + submission.formId + "/submissions/" + req.params.id + "/complete";

  var params = _createRequestParams(_.extend({
    resourcePath: resourcePath,
    method: "POST",
    apiKey: req.get('x-fh-auth-app'),
    appMbaasModel: req.appMbaasModel,
    data: completeStatus
  }, req.params));

  log.logger.debug("notifySubmissionComplete ", {params: params});

  request(params, _createResponseHandler(req, next, true));
}
function notifySubmissionComplete ( req , res , next ) { req . appformsResultPayload = req . appformsResultPayload || { } ; var completeStatus = req . appformsResultPayload . data ; var submission = completeStatus . formSubmission ; //The Submission Is Not Complete, No need to send a notification. if ( "complete" !== completeStatus . status ) { return next ( ) ; } var resourcePath = "/api/v2/appforms/domain/:domain/projects/:projectid/apps/:guid/forms/" + submission . formId + "/submissions/" + req . params . id + "/complete" ; var params = _createRequestParams ( _ . extend ( { resourcePath : resourcePath , method : "POST" , apiKey : req . get ( 'x-fh-auth-app' ) , appMbaasModel : req . appMbaasModel , data : completeStatus } , req . params ) ) ; log . logger . debug ( "notifySubmissionComplete " , { params : params } ) ; request ( params , _createResponseHandler ( req , next , true ) ) ; }
Function To Notify Core Platform That The Submission Is Complete. The core platform will send a mail to any subscribers.
@param req
@param res
@param next
Function To Notify Core Platform That The Submission Is Complete . The core platform will send a mail to any subscribers .