lib/middleware/submissions.js
function updateSubmissionFile(req, res, next) {
  var fileUpdateOptions = req.appformsResultPayload.data;

  fileUpdateOptions.submission = {
    submissionId: req.params.id,
    fieldId: req.params.fieldId
  };

  //Remove the cached file when finished
  fileUpdateOptions.keepFile = false;

  //Adding A New File If Required
  fileUpdateOptions.addingNewSubmissionFile = req.addingNewSubmissionFile;

  //If not adding a new file, the fileId param is expected to be the file group id
  if (!fileUpdateOptions.addingNewSubmissionFile) {
    fileUpdateOptions.fileDetails.groupId = req.params.fileId;
  } else {
    fileUpdateOptions.fileDetails.hashName = req.params.fileId;
  }

  logger.debug("Middleware updateSubmissionFile ", {fileUpdateOptions: fileUpdateOptions});

  forms.updateSubmissionFile(_.extend(fileUpdateOptions, req.connectionOptions), submissionsHandler(constants.resultTypes.submissions, req, next));
}
function updateSubmissionFile(req, res, next) {
  var fileUpdateOptions = req.appformsResultPayload.data;

  fileUpdateOptions.submission = {
    submissionId: req.params.id,
    fieldId: req.params.fieldId
  };

  //Remove the cached file when finished
  fileUpdateOptions.keepFile = false;

  //Adding A New File If Required
  fileUpdateOptions.addingNewSubmissionFile = req.addingNewSubmissionFile;

  //If not adding a new file, the fileId param is expected to be the file group id
  if (!fileUpdateOptions.addingNewSubmissionFile) {
    fileUpdateOptions.fileDetails.groupId = req.params.fileId;
  } else {
    fileUpdateOptions.fileDetails.hashName = req.params.fileId;
  }

  logger.debug("Middleware updateSubmissionFile ", {fileUpdateOptions: fileUpdateOptions});

  forms.updateSubmissionFile(_.extend(fileUpdateOptions, req.connectionOptions), submissionsHandler(constants.resultTypes.submissions, req, next));
}
function updateSubmissionFile ( req , res , next ) { var fileUpdateOptions = req . appformsResultPayload . data ; fileUpdateOptions . submission = { submissionId : req . params . id , fieldId : req . params . fieldId } ; //Remove the cached file when finished fileUpdateOptions . keepFile = false ; //Adding A New File If Required fileUpdateOptions . addingNewSubmissionFile = req . addingNewSubmissionFile ; //If not adding a new file, the fileId param is expected to be the file group id if ( ! fileUpdateOptions . addingNewSubmissionFile ) { fileUpdateOptions . fileDetails . groupId = req . params . fileId ; } else { fileUpdateOptions . fileDetails . hashName = req . params . fileId ; } logger . debug ( "Middleware updateSubmissionFile " , { fileUpdateOptions : fileUpdateOptions } ) ; forms . updateSubmissionFile ( _ . extend ( fileUpdateOptions , req . connectionOptions ) , submissionsHandler ( constants . resultTypes . submissions , req , next ) ) ; }
Update A Single Submission File
@param req
@param res
@param next
Update A Single Submission File