Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reference request error page #2335

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading