lib/middleware/submissions.js
function listProjectSubmissions(req, res, next) {
  var formId = req.body.formId;
  var subIds = req.body.subid;

  var params = {
    wantRestrictions: false,
    appId: req.params.projectid
  };

  //Assigning Form Search If Set
  if (_.isString(formId)) {
    params.formId = formId;
  }

  //Assigning Submission Search Params If Set
  if (_.isArray(subIds)) {
    params.subid = subIds;
  } else if (_.isString(subIds)) {
    params.subid = [subIds];
  }

  logger.debug("Middleware listProjectSubmissions ", {params: params});

  forms.getSubmissions(req.connectionOptions, params, submissionsHandler(constants.resultTypes.submissions, req, next));
}
function listProjectSubmissions(req, res, next) {
  var formId = req.body.formId;
  var subIds = req.body.subid;

  var params = {
    wantRestrictions: false,
    appId: req.params.projectid
  };

  //Assigning Form Search If Set
  if (_.isString(formId)) {
    params.formId = formId;
  }

  //Assigning Submission Search Params If Set
  if (_.isArray(subIds)) {
    params.subid = subIds;
  } else if (_.isString(subIds)) {
    params.subid = [subIds];
  }

  logger.debug("Middleware listProjectSubmissions ", {params: params});

  forms.getSubmissions(req.connectionOptions, params, submissionsHandler(constants.resultTypes.submissions, req, next));
}
function listProjectSubmissions ( req , res , next ) { var formId = req . body . formId ; var subIds = req . body . subid ; var params = { wantRestrictions : false , appId : req . params . projectid } ; //Assigning Form Search If Set if ( _ . isString ( formId ) ) { params . formId = formId ; } //Assigning Submission Search Params If Set if ( _ . isArray ( subIds ) ) { params . subid = subIds ; } else if ( _ . isString ( subIds ) ) { params . subid = [ subIds ] ; } logger . debug ( "Middleware listProjectSubmissions " , { params : params } ) ; forms . getSubmissions ( req . connectionOptions , params , submissionsHandler ( constants . resultTypes . submissions , req , next ) ) ; }
Search Submissions That Belong To The Project.
@param req
@param res
@param next
Search Submissions That Belong To The Project .