summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/users.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb
index f79b61ad85e..236bae4a299 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -276,7 +276,7 @@ module API
email = user.emails.find_by(id: params[:email_id])
not_found!('Email') unless email
- email.destroy
+ Emails::DestroyService.new(current_user, self, email: email.email).execute
::Users::UpdateService.new(current_user, user).execute do |user|
user.update_secondary_emails!
@@ -510,7 +510,8 @@ module API
email = current_user.emails.find_by(id: params[:email_id])
not_found!('Email') unless email
- email.destroy
+ Emails::DestroyService.new(current_user, self, email: email.email).execute
+
::Users::UpdateService.new(current_user, current_user).execute do |user|
user.update_secondary_emails!
end