lib/middleware/forms.js
function _createResponseHandler(req, next, skipDataResult){
  return function(err, httpResponse, responseBody){
    log.logger.debug("Performing Core Action ", req.url, err, httpResponse.statusCode, responseBody);

    if(err || (httpResponse.statusCode !== 200 && httpResponse.statusCode !== 204)){
      return next(err || responseBody);
    }

    //Not interested in the response from the core.
    if(!skipDataResult){
      req.appformsResultPayload = {
        data: responseBody || []
      };
    }

    next();
  };
}
function _createResponseHandler(req, next, skipDataResult){
  return function(err, httpResponse, responseBody){
    log.logger.debug("Performing Core Action ", req.url, err, httpResponse.statusCode, responseBody);

    if(err || (httpResponse.statusCode !== 200 && httpResponse.statusCode !== 204)){
      return next(err || responseBody);
    }

    //Not interested in the response from the core.
    if(!skipDataResult){
      req.appformsResultPayload = {
        data: responseBody || []
      };
    }

    next();
  };
}
function _createResponseHandler ( req , next , skipDataResult ) { return function ( err , httpResponse , responseBody ) { log . logger . debug ( "Performing Core Action " , req . url , err , httpResponse . statusCode , responseBody ) ; if ( err || ( httpResponse . statusCode !== 200 && httpResponse . statusCode !== 204 ) ) { return next ( err || responseBody ) ; } //Not interested in the response from the core. if ( ! skipDataResult ) { req . appformsResultPayload = { data : responseBody || [ ] } ; } next ( ) ; } ; }
Utility function for creating response handlers
@param req
@param next
@returns {Function}
Utility function for creating response handlers