From ac9ced371533b4407855836c3b621855dc86b27c Mon Sep 17 00:00:00 2001 From: Nishiki Liu Date: Sun, 9 Jun 2024 22:24:38 -0700 Subject: [PATCH 1/3] Make sure form success redirect works properly --- app/components/requester_form_component.html.erb | 2 ++ app/controllers/bulk_deletion_requests_controller.rb | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/requester_form_component.html.erb b/app/components/requester_form_component.html.erb index 57cdf8d..d95b398 100644 --- a/app/components/requester_form_component.html.erb +++ b/app/components/requester_form_component.html.erb @@ -1,4 +1,6 @@ <%= form_with(url: @url, class: "requester-form") do |form| %> + <%= form.hidden_field :regulation, value: params[:regulation] %> +
<%= diff --git a/app/controllers/bulk_deletion_requests_controller.rb b/app/controllers/bulk_deletion_requests_controller.rb index 7391c05..e7384f5 100644 --- a/app/controllers/bulk_deletion_requests_controller.rb +++ b/app/controllers/bulk_deletion_requests_controller.rb @@ -20,6 +20,8 @@ def create render(:new, status: :unprocessable_entity) && return end - redirect_to root_path, notice: t(".notice") + redirect_to \ + new_bulk_deletion_request_path(regulation: params[:regulation]), + notice: t(".notice") end end From bb5d1adb7d751fcba7ea1bc8a2e2685f08f4df0b Mon Sep 17 00:00:00 2001 From: Nishiki Liu Date: Sun, 9 Jun 2024 22:25:04 -0700 Subject: [PATCH 2/3] Fire off emails to the right companies --- app/models/bulk_deletion_request.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/bulk_deletion_request.rb b/app/models/bulk_deletion_request.rb index bb1b637..1e6cb26 100644 --- a/app/models/bulk_deletion_request.rb +++ b/app/models/bulk_deletion_request.rb @@ -40,11 +40,11 @@ def deliver_emails private - # Generate a deletion request email for each California data brokers. + # Generate a deletion request email for each company. # # @return [void] def generate_emails - Company.california_data_brokers.find_each.with_index do |company, index| + Company.all.find_each.with_index do |company, index| deletion_request = DeletionRequest.new \ company: company, smtp_config: smtp_config, From a61cc2530a7625c497f5c5c907442769d1f67964 Mon Sep 17 00:00:00 2001 From: Nishiki Liu Date: Sun, 9 Jun 2024 22:29:15 -0700 Subject: [PATCH 3/3] Fix test --- test/integration/deletion_request_flows_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/deletion_request_flows_test.rb b/test/integration/deletion_request_flows_test.rb index 9cf1a42..fb13e89 100644 --- a/test/integration/deletion_request_flows_test.rb +++ b/test/integration/deletion_request_flows_test.rb @@ -21,7 +21,7 @@ class DeletionRequestFlowsTest < ActionDispatch::IntegrationTest # is correct. assert_emails 1 assert_enqueued_emails 1 - assert_redirected_to root_path + assert_redirected_to new_bulk_deletion_request_path assert_equal "Deletion requests being sent through your SMTP provider. Check your email outbox for confirmation.", flash[:notice] # The rest of the emails should be able to be delivered later.