Browse Source

feat: route to uprn confirmation from check answers changes to uprn even though not an interruption screen

pull/1538/head
natdeanlewissoftwire 2 years ago
parent
commit
d2513d75a2
  1. 4
      app/controllers/form_controller.rb

4
app/controllers/form_controller.rb

@ -128,7 +128,7 @@ private
next_page = form.get_page(next_page_id) next_page = form.get_page(next_page_id)
previous_page = form.previous_page(page_ids, page_index, @log, current_user) previous_page = form.previous_page(page_ids, page_index, @log, current_user)
if next_page&.interruption_screen? || next_page_id == previous_page if next_page&.interruption_screen? || next_page_id == previous_page || CONFIRMATION_PAGE_IDS.include?(next_page_id)
return send("#{@log.class.name.underscore}_#{next_page_id}_path", @log, { referrer: "check_answers" }) return send("#{@log.class.name.underscore}_#{next_page_id}_path", @log, { referrer: "check_answers" })
else else
return send("#{@log.model_name.param_key}_#{form.subsection_for_page(@page).id}_check_answers_path", @log) return send("#{@log.model_name.param_key}_#{form.subsection_for_page(@page).id}_check_answers_path", @log)
@ -182,4 +182,6 @@ private
redirect_to lettings_log_path(@log) unless @log.collection_period_open? redirect_to lettings_log_path(@log) unless @log.collection_period_open?
end end
CONFIRMATION_PAGE_IDS = %w[uprn_confirmation].freeze
end end

Loading…
Cancel
Save