diff --git a/app/controllers/assessor_interface/professional_standing_requests_controller.rb b/app/controllers/assessor_interface/professional_standing_requests_controller.rb index 9fd7709c8f..fa2126dd25 100644 --- a/app/controllers/assessor_interface/professional_standing_requests_controller.rb +++ b/app/controllers/assessor_interface/professional_standing_requests_controller.rb @@ -93,29 +93,32 @@ def update_review end def edit_verify - authorize [:assessor_interface, professional_standing_request], - :edit_review? + authorize [:assessor_interface, professional_standing_request] @form = - RequestableReviewForm.new( + RequestableVerifyForm.new( requestable:, user: current_staff, - passed: requestable.review_passed, - note: requestable.review_note, + passed: requestable.verify_passed, + note: requestable.verify_note, ) end def update_verify - authorize [:assessor_interface, professional_standing_request], - :update_review? + authorize [:assessor_interface, professional_standing_request] @form = - RequestableReviewForm.new( - review_form_params.merge(requestable:, user: current_staff), + RequestableVerifyForm.new( + verify_form_params.merge(requestable:, user: current_staff), ) if @form.save - redirect_to [:assessor_interface, application_form] + redirect_to [ + :assessor_interface, + application_form, + assessment, + :professional_standing_request, + ] else render :edit_verify, status: :unprocessable_entity end @@ -148,6 +151,13 @@ def review_form_params ) end + def verify_form_params + params.require(:assessor_interface_requestable_verify_form).permit( + :passed, + :note, + ) + end + def professional_standing_request @professional_standing_request ||= ProfessionalStandingRequest.joins( diff --git a/app/views/assessor_interface/professional_standing_requests/edit_verify.html.erb b/app/views/assessor_interface/professional_standing_requests/edit_verify.html.erb index 7a8b10263f..816f027fba 100644 --- a/app/views/assessor_interface/professional_standing_requests/edit_verify.html.erb +++ b/app/views/assessor_interface/professional_standing_requests/edit_verify.html.erb @@ -1,28 +1,19 @@ -<% title = region_certificate_name(@application_form.region) %> - -<% content_for :page_title, "#{"Error: " if @form.errors.any?}#{title}" %> +<% content_for :page_title, "#{"Error: " if @form.errors.any?}Record LoPS response" %> <% content_for :back_link_url, assessor_interface_application_form_path(@application_form) %> <%= form_with model: @form, url: [:verify, :assessor_interface, @application_form, @assessment, :professional_standing_request] do |f| %> <%= f.govuk_error_summary %> -