diff options
Diffstat (limited to 'app/services/emails/destroy_service.rb')
-rw-r--r-- | app/services/emails/destroy_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/emails/destroy_service.rb b/app/services/emails/destroy_service.rb index d586b9dfe0c..1ed131fe326 100644 --- a/app/services/emails/destroy_service.rb +++ b/app/services/emails/destroy_service.rb @@ -1,13 +1,13 @@ module Emails class DestroyService < ::Emails::BaseService - def execute - Email.find_by_email!(@email).destroy && update_secondary_emails! + def execute(email) + email.destroy && update_secondary_emails! end private def update_secondary_emails! - result = ::Users::UpdateService.new(@user).execute do |user| + result = ::Users::UpdateService.new(@current_user, user: @user).execute do |user| user.update_secondary_emails! end |