Skip to content

Commit

Permalink
fix multi file send
Browse files Browse the repository at this point in the history
  • Loading branch information
rolorogan committed May 13, 2024
1 parent d1a48a9 commit d1958c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/App/Form/Summary/Sections/SendRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const SendYourRequest = () => {
const fileData = [];
const applicationNumber = Math.floor(Math.random() * 10000000 + 1).toString();
const files = [
[formDataState.ApplicantPhoto],
formDataState.ApplicantPhoto,
formDataState.proofDocumentArms ? [...formDataState.proofDocumentArms] : [],
formDataState.proofDocumentBlind ? [...formDataState.proofDocumentBlind] : [],
formDataState.proofDocumentDeaf ? [...formDataState.proofDocumentDeaf] : [],
Expand All @@ -38,6 +38,8 @@ const SendYourRequest = () => {
formDataState.proofDocumentWalk ? [...formDataState.proofDocumentWalk] : [],
];
const checkAnswersEl = document.getElementById('application-summary');
// concatenate files
const concatFiles = files.flat();
// remove change button
const editedText =
checkAnswersEl &&
Expand All @@ -56,7 +58,7 @@ const SendYourRequest = () => {
reader.onload = () => resolve(reader.result);
reader.onerror = (error) => reject(error);
});
const filteredFiles = files.filter((n) => n);
const filteredFiles = concatFiles.filter((n) => n);
// eslint-disable-next-line no-plusplus
for (let i = 0; i < filteredFiles.length; i++) {
// eslint-disable-next-line no-await-in-loop
Expand Down

0 comments on commit d1958c9

Please sign in to comment.