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 @@
{{ govukButton({ text: "I agree - send evidence", - href: "/round-8/e5/sending-data", + href: "/round-9/e6/sending-data", preventDoubleClick: true }) }} diff --git a/app/views/round-9/e6/file-check.njk b/app/views/round-9/e6/file-check.njk index 97d8c80..ca9f52b 100644 --- a/app/views/round-9/e6/file-check.njk +++ b/app/views/round-9/e6/file-check.njk @@ -21,7 +21,7 @@

- Checking your file + Checking your file(s)

setTimeout(() => { - window.location.href="/round-8/e5/upload-table" + window.location.href="/round-9/e6/upload-table" }, 3000) diff --git a/app/views/round-9/e6/sending-data.njk b/app/views/round-9/e6/sending-data.njk index 682b7cd..6ca9bac 100644 --- a/app/views/round-9/e6/sending-data.njk +++ b/app/views/round-9/e6/sending-data.njk @@ -39,7 +39,7 @@ diff --git a/app/views/round-9/e6/upload-another-page.njk b/app/views/round-9/e6/upload-another-page.njk index 545221c..7c7a5a4 100644 --- a/app/views/round-9/e6/upload-another-page.njk +++ b/app/views/round-9/e6/upload-another-page.njk @@ -47,13 +47,12 @@
- - + + + +
diff --git a/app/views/round-9/e6/upload-evidence.njk b/app/views/round-9/e6/upload-evidence.njk index 535e904..25e9361 100644 --- a/app/views/round-9/e6/upload-evidence.njk +++ b/app/views/round-9/e6/upload-evidence.njk @@ -35,15 +35,13 @@
- - -
+ + + +
diff --git a/app/views/round-9/e6/upload-table.njk b/app/views/round-9/e6/upload-table.njk index 5f4a7ea..1d700c6 100644 --- a/app/views/round-9/e6/upload-table.njk +++ b/app/views/round-9/e6/upload-table.njk @@ -54,7 +54,7 @@
- Remove + Remove