diff --git a/app/routes.js b/app/routes.js index 3ba1ad0..e7e89e3 100644 --- a/app/routes.js +++ b/app/routes.js @@ -2559,9 +2559,6 @@ router.all( } ); - - - // e6 // var filenames = []; @@ -2646,27 +2643,15 @@ router.post("/round-9/e6/upload-evidence-type", function (req, res) { }); router.post("/round-9/e6/upload-evidence-form", function (req, res) { - var fileName = req.session.data["file-upload"].replaceAll(" ", ""); - // filenames.push(fileName); - // req.session.data.benefitsArray = filenames; - - // const index = benefits.findIndex( - // (benefit) => benefit.name === req.session.data["yourBenefits"] - // ); - // benefits[index].files.push(fileName); - - // currentFiles.push(fileName); - // req.session.data.currentFiles = currentFiles; - - // console.log(benefits); - - // req.session.data.benefits = benefits; - - // console.log(JSON.stringify(req.session.data.benefits)); - console.log("hello + " + JSON.stringify(req.session.data)); - req.session.data.benefits[0].files.push(fileName); + if (Array.isArray(req.session.data["file-upload"])) { + req.session.data["file-upload"].forEach((file) => { + req.session.data.benefits[0].files.push(file); + }); + } else { + req.session.data.benefits[0].files.push(req.session.data["file-upload"]); + } res.redirect("/round-9/e6/file-check"); }); diff --git a/app/views/round-9/e6/are-you-sure.njk b/app/views/round-9/e6/are-you-sure.njk index 98fb4d0..535852f 100644 --- a/app/views/round-9/e6/are-you-sure.njk +++ b/app/views/round-9/e6/are-you-sure.njk @@ -72,7 +72,7 @@ } } if (!hasSelection) { - window.location.href = "/round-8/e5/error/are-you-sure"; + window.location.href = "/round-9/e6/error/are-you-sure"; } else { if (document.getElementById("yes").checked) { window.location.href = "upload-table?file={{ fileToDelete }}" diff --git a/app/views/round-9/e6/declaration.njk b/app/views/round-9/e6/declaration.njk index 968212a..b918c51 100644 --- a/app/views/round-9/e6/declaration.njk +++ b/app/views/round-9/e6/declaration.njk @@ -46,7 +46,7 @@