lib/middleware/forms.js
function search(req, res, next) {
  var projectForms = req.appformsResultPayload.data || [];
  //Only Want The Project Ids
  projectForms = _.map(projectForms, function(form) {
    if (_.isObject(form)) {
      return form._id;
    } else {
      return form;
    }
  });

  var formsToFind = req.body || [];

  formsToFind = _.filter(projectForms, function(projFormId) {
    return formsToFind.indexOf(projFormId) > -1;
  });

  logger.debug("Middleware: search forms: ", {connection: req.connectionOptions, projectForms: projectForms});

  forms.findForms(req.connectionOptions, formsToFind, function(err, formsList) {
    if (err) {
      return next(err);
    }

    async.map(formsList, function(foundForm, cb) {
      var getParams = {
        "_id": foundForm._id,
        "showAdminFields": false
      };
      forms.getForm(_.extend(_.clone(req.connectionOptions), getParams), cb);
    }, formsResultHandlers(constants.resultTypes.forms, req, next));
  });
}
function search(req, res, next) {
  var projectForms = req.appformsResultPayload.data || [];
  //Only Want The Project Ids
  projectForms = _.map(projectForms, function(form) {
    if (_.isObject(form)) {
      return form._id;
    } else {
      return form;
    }
  });

  var formsToFind = req.body || [];

  formsToFind = _.filter(projectForms, function(projFormId) {
    return formsToFind.indexOf(projFormId) > -1;
  });

  logger.debug("Middleware: search forms: ", {connection: req.connectionOptions, projectForms: projectForms});

  forms.findForms(req.connectionOptions, formsToFind, function(err, formsList) {
    if (err) {
      return next(err);
    }

    async.map(formsList, function(foundForm, cb) {
      var getParams = {
        "_id": foundForm._id,
        "showAdminFields": false
      };
      forms.getForm(_.extend(_.clone(req.connectionOptions), getParams), cb);
    }, formsResultHandlers(constants.resultTypes.forms, req, next));
  });
}
function search ( req , res , next ) { var projectForms = req . appformsResultPayload . data || [ ] ; //Only Want The Project Ids projectForms = _ . map ( projectForms , function ( form ) { if ( _ . isObject ( form ) ) { return form . _id ; } else { return form ; } } ) ; var formsToFind = req . body || [ ] ; formsToFind = _ . filter ( projectForms , function ( projFormId ) { return formsToFind . indexOf ( projFormId ) > - 1 ; } ) ; logger . debug ( "Middleware: search forms: " , { connection : req . connectionOptions , projectForms : projectForms } ) ; forms . findForms ( req . connectionOptions , formsToFind , function ( err , formsList ) { if ( err ) { return next ( err ) ; } async . map ( formsList , function ( foundForm , cb ) { var getParams = { "_id" : foundForm . _id , "showAdminFields" : false } ; forms . getForm ( _ . extend ( _ . clone ( req . connectionOptions ) , getParams ) , cb ) ; } , formsResultHandlers ( constants . resultTypes . forms , req , next ) ) ; } ) ; }
Function to list forms that are deployed.

The request should contain an array of deployed forms.

@param req
@param res
@param next
Function to list forms that are deployed .