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
email = user.emails.find(params[:email_id])
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!
end
......@@ -215,7 +215,7 @@ class Admin::UsersController < Admin::ApplicationController
end
def update_user
result = Users::UpdateService.new(current_user, user).execute do
result = Users::UpdateService.new(current_user, user).execute do |user|
yield(user)
end
......
......@@ -277,7 +277,10 @@ module API
not_found!('Email') unless email
email.destroy
user.update_secondary_emails!
Users::UpdateService.new(current_user, user).execute do |user|
user.update_secondary_emails!
end
end
desc 'Delete a user. Available only for admins.' do
......@@ -508,7 +511,9 @@ module API
not_found!('Email') unless email
email.destroy
current_user.update_secondary_emails!
Users::UpdateService.new(current_user, user).execute do |user|
user.update_secondary_emails!
end
end
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