diff --git a/app/controllers/return-requirements.controller.js b/app/controllers/return-requirements.controller.js index 6e6228133b..83cd9531e8 100644 --- a/app/controllers/return-requirements.controller.js +++ b/app/controllers/return-requirements.controller.js @@ -80,13 +80,8 @@ async function saveReturnsCheckYourAnswers (request, h) { } async function requirementsApproved (request, h) { - const { sessionId } = request.params - - const session = await SessionModel.query().findById(sessionId) - return h.view('return-requirements/requirements-approved.njk', { - activeNavBar: 'search', - ...session + activeNavBar: 'search' }) } @@ -106,7 +101,7 @@ async function saveNoReturnsRequired (request, h) { const session = await SessionModel.query().findById(sessionId) - return h.redirect(`/system/return-requirements/${session.id}/no-returns-check-your-answers`) + return h.redirect(`/system/return-requirements/${session.id}/no-return-check-your-answers`) } async function noReturnsCheckYourAnswers (request, h) { diff --git a/app/routes/return-requirement.routes.js b/app/routes/return-requirement.routes.js index 2339d56b83..2b4df020af 100644 --- a/app/routes/return-requirement.routes.js +++ b/app/routes/return-requirement.routes.js @@ -101,7 +101,7 @@ const routes = [ } }, { method: 'GET', - path: '/return-requirements/{sessionId}/requirements-approved', + path: '/return-requirements/requirements-approved', handler: ReturnRequirementsController.requirementsApproved, options: { auth: { diff --git a/app/views/return-requirements/add-a-note.njk b/app/views/return-requirements/add-a-note.njk index 3e2dea4d75..a6ad6c78df 100644 --- a/app/views/return-requirements/add-a-note.njk +++ b/app/views/return-requirements/add-a-note.njk @@ -2,7 +2,7 @@ {% from "govuk/components/back-link/macro.njk" import govukBackLink %} {% from "govuk/components/button/macro.njk" import govukButton %} -{% set rootLink = "/system/licences/" + licenceId %} +{% set rootLink = "/system/return-requirements/" + id %} {% block breadcrumbs %} {# Back link #} {{ diff --git a/app/views/return-requirements/no-return-check-your-answers.njk b/app/views/return-requirements/no-return-check-your-answers.njk index e1db24282a..ab1a836904 100644 --- a/app/views/return-requirements/no-return-check-your-answers.njk +++ b/app/views/return-requirements/no-return-check-your-answers.njk @@ -2,7 +2,7 @@ {% from "govuk/components/back-link/macro.njk" import govukBackLink %} {% from "govuk/components/button/macro.njk" import govukButton %} -{% set rootLink = "/system/licences/" + licenceId %} +{% set rootLink = "/system/return-requirements/" + id %} {% block breadcrumbs %} {# Back link #} {{ diff --git a/app/views/return-requirements/no-returns-required.njk b/app/views/return-requirements/no-returns-required.njk index d2073ee98b..da0e239e16 100644 --- a/app/views/return-requirements/no-returns-required.njk +++ b/app/views/return-requirements/no-returns-required.njk @@ -2,7 +2,7 @@ {% from "govuk/components/back-link/macro.njk" import govukBackLink %} {% from "govuk/components/button/macro.njk" import govukButton %} -{% set rootLink = "/system/licences/" + licenceId %} +{% set rootLink = "/system/return-requirements/" + id %} {% block breadcrumbs %} {# Back link #} {{ diff --git a/app/views/return-requirements/reason.njk b/app/views/return-requirements/reason.njk index 37bdca354c..9ac8dacb1a 100644 --- a/app/views/return-requirements/reason.njk +++ b/app/views/return-requirements/reason.njk @@ -3,13 +3,13 @@ {% from "govuk/components/button/macro.njk" import govukButton %} {% set title = "Select the reason for the return requirement" %} -{% set rootLink = "/system/licences/" + licenceId %} +{% set rootLink = "/system/return-requirements/" + id %} {% block breadcrumbs %} {# Back link #} {{ govukBackLink({ - text: 'back', + text: 'Back', href: rootLink + "/" }) }} diff --git a/app/views/return-requirements/returns-check-your-answers.njk b/app/views/return-requirements/returns-check-your-answers.njk index 8f28758beb..a5a43a72fb 100644 --- a/app/views/return-requirements/returns-check-your-answers.njk +++ b/app/views/return-requirements/returns-check-your-answers.njk @@ -2,7 +2,7 @@ {% from "govuk/components/back-link/macro.njk" import govukBackLink %} {% from "govuk/components/button/macro.njk" import govukButton %} -{% set rootLink = "/system/licences/" + licenceId %} +{% set rootLink = "/system/return-requirements/" + id %} {% block breadcrumbs %} {# Back link #} {{ diff --git a/app/views/return-requirements/returns-how-do-you-want.njk b/app/views/return-requirements/returns-how-do-you-want.njk index d318c0355d..d4b51658d9 100644 --- a/app/views/return-requirements/returns-how-do-you-want.njk +++ b/app/views/return-requirements/returns-how-do-you-want.njk @@ -1,17 +1,17 @@ {% extends 'layout.njk' %} -{# {% from "govuk/components/back-link/macro.njk" import govukBackLink %} #} -{# {% from "govuk/components/button/macro.njk" import govukButton %} #} +{% from "govuk/components/back-link/macro.njk" import govukBackLink %} +{% from "govuk/components/button/macro.njk" import govukButton %} -{# {% set rootLink = "/system/licences/" + licenceId %} #} +{% set rootLink = "/system/return-requirements/" + id %} {% block breadcrumbs %} {# Back link #} - {# {{ + {{ govukBackLink({ - text: 'back', + text: 'Back', href: rootLink + "/reason" }) - }} #} + }} {% endblock %} {% block content %} @@ -20,9 +20,9 @@

How do you want to set up the return requirement?

- {#
+
{{ govukButton({ text: "Continue" }) }}
-
#} + {% endblock %} diff --git a/app/views/return-requirements/select-return-start-date.njk b/app/views/return-requirements/select-return-start-date.njk index 5a4e973ae8..823f81e6db 100644 --- a/app/views/return-requirements/select-return-start-date.njk +++ b/app/views/return-requirements/select-return-start-date.njk @@ -2,7 +2,7 @@ {% from "govuk/components/back-link/macro.njk" import govukBackLink %} {% from "govuk/components/button/macro.njk" import govukButton %} -{% set rootLink = "/system/licences/" + licenceId %} +{% set rootLink = "/system/return-requirements/" + id %} {% block breadcrumbs %} {# Back link #} {{ diff --git a/test/controllers/return-requirements.controller.test.js b/test/controllers/return-requirements.controller.test.js index 6f78cb0eed..8f32112467 100644 --- a/test/controllers/return-requirements.controller.test.js +++ b/test/controllers/return-requirements.controller.test.js @@ -112,10 +112,10 @@ describe('Return requirements controller', () => { }) }) - describe('GET /return-requirements/{sessionId}/requirements-approved', () => { + describe('GET /return-requirements/requirements-approved', () => { const options = { method: 'GET', - url: '/return-requirements/64924759-8142-4a08-9d1e-1e902cd9d316/requirements-approved', + url: '/return-requirements/requirements-approved', auth: { strategy: 'session', credentials: { scope: ['billing'] }