diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb index 40f367cf1..a99c78dcf 100644 --- a/app/controllers/organisations_controller.rb +++ b/app/controllers/organisations_controller.rb @@ -40,7 +40,7 @@ class OrganisationsController < ApplicationController end def email_schemes_csv - DownloadRecord.build_from_user(download_type: :scheme, download_filters: session_filters.merge({ download_type: params[:download_type] }).to_s, user: current_user).save! + DownloadRecord.build_from_user(download_type: :scheme_location, download_filters: session_filters.merge({ download_type: params[:download_type] }).to_s, user: current_user).save! SchemeEmailCsvJob.perform_later(current_user, search_term, session_filters, false, @organisation, params[:download_type]) redirect_to schemes_csv_confirmation_organisation_path end diff --git a/app/controllers/schemes_controller.rb b/app/controllers/schemes_controller.rb index ebab2ff28..b5e796f72 100644 --- a/app/controllers/schemes_controller.rb +++ b/app/controllers/schemes_controller.rb @@ -236,7 +236,7 @@ class SchemesController < ApplicationController end def email_csv - DownloadRecord.build_from_user(download_type: :scheme, download_filters: session_filters.merge({ download_type: params[:download_type] }).to_s, user: current_user).save! + DownloadRecord.build_from_user(download_type: :scheme_location, download_filters: session_filters.merge({ download_type: params[:download_type] }).to_s, user: current_user).save! all_orgs = params["organisation_select"] == "all" SchemeEmailCsvJob.perform_later(current_user, search_term, session_filters, all_orgs, nil, params[:download_type]) redirect_to csv_confirmation_schemes_path