Skip to content

Commit

Permalink
Merge pull request #2335 from DFE-Digital/reset-reference-request
Browse files Browse the repository at this point in the history
Add reference request error page
  • Loading branch information
thomasleese authored Aug 23, 2024
2 parents 8e0754a + b416ae9 commit 395d091
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class ReferenceRequestsController < BaseController
skip_before_action :authenticate_teacher!
before_action :load_requested_reference_request, except: :show

rescue_from ActiveRecord::RecordNotFound, with: :error_not_found

define_history_origin :show
define_history_reset :show
define_history_check :edit
Expand All @@ -25,6 +27,10 @@ def show
@work_history = reference_request.work_history
end

def error_not_found
render "error_not_found", status: :not_found
end

def edit
@work_history = reference_request.work_history
end
Expand Down
2 changes: 2 additions & 0 deletions app/services/update_work_history_contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def call
end

if email.present? && (reference_request = work_history.reference_request)
reference_request.regenerate_slug

RequestRequestable.call(
requestable: reference_request,
user:,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :page_title, "We no longer need you to act as a reference." %>

<h1 class="govuk-heading-xl"><%= t("service.name.eligibility") %></h1>

<p class="govuk-body">We no longer need you to act as a reference.</p>

<p class="govuk-body">You do not need to do anything else.</p>

0 comments on commit 395d091

Please sign in to comment.