Skip to content
This repository was archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
Fix left over with old naming
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsilver committed Jul 12, 2018
1 parent 34f26c3 commit 225e35b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 31 deletions.
44 changes: 20 additions & 24 deletions app/routes/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ router.get('/app/cases/:id/fr/decision', (req, res) => {
});

router.post('/app/cases/:id/fr/decision', (req, res) => {
if(req.body.approve === 'Reject') {
res.redirect(`/app/cases/${req.params.id}/fr/reject-reasons`);
if(req.body.decision === 'Approve') {
res.redirect(`/app/cases/${req.params.id}/fr/notes`);
} else if(req.body.decision === 'Approve with changes') {
res.redirect(`/app/cases/${req.params.id}/fr/upload-1`);
} else {
res.redirect(`/app/cases/${req.params.id}/fr/upload-1`);
}
Expand All @@ -98,21 +100,18 @@ router.get('/app/cases/:id/fr/upload-1', (req, res) => {
});

router.post('/app/cases/:id/fr/upload-1', (req, res) => {
switch(req.session.data.uploadnew) {
case 'yes':
res.redirect(`/app/cases/${req.params.id}/fr/upload-2`);
break;
case 'no':
switch(req.session.data.decision) {
case 'Approve':
case 'Approve with changes':
res.redirect(`/app/cases/${req.params.id}/fr/notes`);
break;
case 'Reject':
res.redirect(`/app/cases/${req.params.id}/fr/reject-reasons`);
break;
}
break;
if(req.body.uploadnew == 'Yes') {
res.redirect(`/app/cases/${req.params.id}/fr/upload-2`);
} else {
switch(req.session.data.decision) {
case 'Approve':
case 'Approve with changes':
res.redirect(`/app/cases/${req.params.id}/fr/notes`);
break;
case 'Reject':
res.redirect(`/app/cases/${req.params.id}/fr/reject-reasons`);
break;
}
}
});

Expand All @@ -132,13 +131,10 @@ router.get('/app/cases/:id/fr/upload-2', (req, res) => {
});

router.post('/app/cases/:id/fr/upload-2', (req, res) => {
switch(req.session.data.decision) {
case 'Approve with changes':
res.redirect(`/app/cases/${req.params.id}/fr/notes`);
break;
case 'Reject':
res.redirect(`/app/cases/${req.params.id}/fr/reject-reasons`);
break;
if(req.session.data.decision === 'Approve with changes') {
res.redirect(`/app/cases/${req.params.id}/fr/notes`);
} else {
res.redirect(`/app/cases/${req.params.id}/fr/reject-reasons`);
}
});

Expand Down
2 changes: 1 addition & 1 deletion app/views/app/case/fr/decision/check.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h1 class="govuk-heading-xl">Check your decision</h1>
</dd>

</div>
{% if reasons %}
{% if reasons.length %}
<div class="app-check-your-answers__contents">

<dt class="app-check-your-answers__question">Reasons</dt>
Expand Down
7 changes: 3 additions & 4 deletions app/views/app/case/fr/decision/confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@

<div class="govuk-panel govuk-panel--confirmation">
<h2 class="govuk-panel__title">
{% if data.decision == 'approve' %}
{% if data.decision == 'Approve' %}
Consent order approved
{% elseif data.decision == 'approve-with-changes' %}
{% elseif data.decision == 'Approve with changes' %}
Consent order approved with changes
{% elseif data.decision == 'reject' %}
{% elseif data.decision == 'Reject' %}
Consent order rejected
{% endif %}

</h2>
<div class="govuk-panel__body">
{{_case.id}}
Expand Down
4 changes: 2 additions & 2 deletions app/views/app/case/fr/decision/upload-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
},
items: [
{
value: 'yes',
value: 'Yes',
html: 'Yes'
},
{
value: 'no',
value: 'No',
html: 'No'
}
]
Expand Down

0 comments on commit 225e35b

Please sign in to comment.