department-of-veterans-affairs/vets-website

View on GitHub
src/applications/hca/utils/helpers/file-attachments.js

Summary

Maintainability
A
50 mins
Test Coverage
export const createPayload = file => {
  const payload = new FormData();
  payload.append('hca_attachment[file_data]', file);
  return payload;
};

export const parseResponse = (response, file) => ({
  name: file.name,
  confirmationCode: response.data.attributes.guid,
  size: file.size,
});