diff options
author | James Lopez <james@jameslopez.es> | 2017-09-20 11:00:06 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-09-28 08:46:39 +0200 |
commit | 9621dd0c9d31508bdac2e2e226537302b560ef10 (patch) | |
tree | f4e76be89a6cb1a85b04e87cdf33bb408f2bf63f /lib/api/users.rb | |
parent | 11c8b8bc3c2294ef2e3a33196619f6e61f1e8d82 (diff) | |
download | gitlab-ce-9621dd0c9d31508bdac2e2e226537302b560ef10.tar.gz |
refactor services to match EE signature
Diffstat (limited to 'lib/api/users.rb')
-rw-r--r-- | lib/api/users.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index 77ac24ec68d..b157940eaa6 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -166,7 +166,7 @@ module API user_params[:password_expires_at] = Time.now if user_params[:password].present? - result = ::Users::UpdateService.new(user, user_params.except(:extern_uid, :provider)).execute + result = ::Users::UpdateService.new(current_user, user, user_params.except(:extern_uid, :provider)).execute if result[:status] == :success present user, with: Entities::UserPublic @@ -326,7 +326,7 @@ module API user = User.find_by(id: params.delete(:id)) not_found!('User') unless user - email = Emails::CreateService.new(user, declared_params(include_missing: false)).execute + email = Emails::CreateService.new(current_user, user, declared_params(include_missing: false)).execute if email.errors.blank? NotificationService.new.new_email(email) @@ -367,7 +367,7 @@ module API not_found!('Email') unless email destroy_conditionally!(email) do |email| - Emails::DestroyService.new(current_user, email: email.email).execute + Emails::DestroyService.new(current_user, user, email: email.email).execute end user.update_secondary_emails! @@ -672,7 +672,7 @@ module API requires :email, type: String, desc: 'The new email' end post "emails" do - email = Emails::CreateService.new(current_user, declared_params).execute + email = Emails::CreateService.new(current_user, current_user, declared_params).execute if email.errors.blank? NotificationService.new.new_email(email) @@ -691,7 +691,7 @@ module API not_found!('Email') unless email destroy_conditionally!(email) do |email| - Emails::DestroyService.new(current_user, email: email.email).execute + Emails::DestroyService.new(current_user, current_user, email: email.email).execute end current_user.update_secondary_emails! |