Skip to content

Commit 2a53eef

Browse files
committed
not sure change to checkboxes
1 parent 37774b1 commit 2a53eef

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

app/routes.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,19 @@ router.post('/powers-answer', (req, res) => {
3636
const powers = req.session.data.powers
3737

3838
// Check whether the variable matches a condition
39-
if (powers === 'no') {
39+
if (powers && powers.includes("no")) {
4040

4141
// Send user to a page where they’ll enter their NHS number
4242
res.redirect('/ineligible')
4343

44-
} else {
44+
}
45+
else if (powers){
46+
res.redirect("/check-your-answers2")
47+
}
48+
else {
4549

4650
// Send user back to the question page
47-
res.redirect('/check-your-answers2')
51+
res.redirect('/not-sure')
4852

4953
}
5054
})

app/views/check-your-answers2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h2 class="nhsuk-heading-m">
5151
text: "not listed"
5252
},
5353
value: {
54-
text: data.powers
54+
html: data.powers | join("<br>")
5555
},
5656
actions: {
5757
items: [

app/views/not-sure.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<div class="nhsuk-grid-column-two-thirds">
2020
<form action="/powers-answer" method="post" novalidate>
2121

22-
{{ radios({
22+
{{ checkboxes ({
2323
name: "powers",
2424
fieldset: {
2525
legend: {
@@ -28,7 +28,7 @@
2828
classes: "nhsuk-fieldset__legend--l"
2929
}
3030
},
31-
value: data.powers,
31+
values: data.powers,
3232

3333
items: [
3434
{
@@ -49,7 +49,8 @@
4949
},
5050
{
5151
value: "no",
52-
text: "None of these"
52+
text: "None of these",
53+
exclusive: true
5354
}
5455
]
5556
}) }}

0 commit comments

Comments
 (0)