From 978f89c271412d55348288dabfee659f3908b6fa Mon Sep 17 00:00:00 2001 From: Jason Claxton Date: Mon, 30 Dec 2024 17:21:59 +0000 Subject: [PATCH] Add validation --- app/views/return-logs/edit.njk | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/views/return-logs/edit.njk b/app/views/return-logs/edit.njk index 0bd9c9aca0..3458b855b5 100644 --- a/app/views/return-logs/edit.njk +++ b/app/views/return-logs/edit.njk @@ -1,6 +1,7 @@ {% extends 'layout.njk' %} {% from "govuk/components/back-link/macro.njk" import govukBackLink %} {% from "govuk/components/button/macro.njk" import govukButton %} +{% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} {% from "govuk/components/radios/macro.njk" import govukRadios %} {% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} @@ -13,6 +14,19 @@ {% endblock %} {% block content %} + {# Error message #} + {% if error %} + {{ govukErrorSummary({ + titleText: "There is a problem", + errorList: [ + { + text: error, + href: '#' + } + ] + }) }} + {% endif %} + {# Main heading #}
@@ -92,6 +106,7 @@ {{ govukRadios({ name: "howToEdit", + errorMessage: error, fieldset: { legend: { text: "How would you like to edit this return?", @@ -113,7 +128,7 @@ text: "Enter a nil return" }, { - value: '/return-logs/edit/query?returnLogId=' + returnLogId, + value: 'query', text: queryText } ]