fix api and controller issues

This commit is contained in:
James Lopez 2017-06-16 10:29:43 +02:00
parent 36bc2e9016
commit bf3a3f3652
2 changed files with 9 additions and 4 deletions

View file

@ -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

View file

@ -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'