Commit bf3a3f36 authored by James Lopez's avatar James Lopez

fix api and controller issues

parent 36bc2e90
...@@ -154,7 +154,7 @@ class Admin::UsersController < Admin::ApplicationController ...@@ -154,7 +154,7 @@ class Admin::UsersController < Admin::ApplicationController
email = user.emails.find(params[:email_id]) email = user.emails.find(params[:email_id])
email.destroy email.destroy
result = Users::UpdateService.new(current_user, @user).execute do result = Users::UpdateService.new(current_user, @user).execute do |user|
user.update_secondary_emails! user.update_secondary_emails!
end end
...@@ -215,7 +215,7 @@ class Admin::UsersController < Admin::ApplicationController ...@@ -215,7 +215,7 @@ class Admin::UsersController < Admin::ApplicationController
end end
def update_user def update_user
result = Users::UpdateService.new(current_user, user).execute do result = Users::UpdateService.new(current_user, user).execute do |user|
yield(user) yield(user)
end end
......
...@@ -277,7 +277,10 @@ module API ...@@ -277,7 +277,10 @@ module API
not_found!('Email') unless email not_found!('Email') unless email
email.destroy email.destroy
user.update_secondary_emails!
Users::UpdateService.new(current_user, user).execute do |user|
user.update_secondary_emails!
end
end end
desc 'Delete a user. Available only for admins.' do desc 'Delete a user. Available only for admins.' do
...@@ -508,7 +511,9 @@ module API ...@@ -508,7 +511,9 @@ module API
not_found!('Email') unless email not_found!('Email') unless email
email.destroy email.destroy
current_user.update_secondary_emails! Users::UpdateService.new(current_user, user).execute do |user|
user.update_secondary_emails!
end
end end
desc 'Get a list of user activities' desc 'Get a list of user activities'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment