diff options
author | James Lopez <james@jameslopez.es> | 2017-09-27 11:48:33 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-09-28 08:46:39 +0200 |
commit | 67d06dee30379fc93be196e2cf509660d1661aea (patch) | |
tree | de02bb9866dcc70cc7e65f9599bc7e8392060775 /lib/api | |
parent | cbb90d8f84d1f79560066d8ea3c6346906e7da94 (diff) | |
download | gitlab-ce-67d06dee30379fc93be196e2cf509660d1661aea.tar.gz |
refactor users update service
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/internal.rb | 2 | ||||
-rw-r--r-- | lib/api/notification_settings.rb | 2 | ||||
-rw-r--r-- | lib/api/users.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index 3d331ffdce2..a0557a609ca 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -136,7 +136,7 @@ module API codes = nil - ::Users::UpdateService.new(current_user, user).execute! do |user| + ::Users::UpdateService.new(current_user, user: user).execute! do |user| codes = user.generate_otp_backup_codes! end diff --git a/lib/api/notification_settings.rb b/lib/api/notification_settings.rb index 1c5592d952d..0266bf2f717 100644 --- a/lib/api/notification_settings.rb +++ b/lib/api/notification_settings.rb @@ -35,7 +35,7 @@ module API new_notification_email = params.delete(:notification_email) if new_notification_email - ::Users::UpdateService.new(current_user, current_user, notification_email: new_notification_email).execute + ::Users::UpdateService.new(current_user, user: current_user, notification_email: new_notification_email).execute end notification_setting.update(declared_params(include_missing: false)) diff --git a/lib/api/users.rb b/lib/api/users.rb index b157940eaa6..ce5d75965d5 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(current_user, user, user_params.except(:extern_uid, :provider)).execute + result = ::Users::UpdateService.new(current_user, user_params.except(:extern_uid, :provider).merge(user: user)).execute if result[:status] == :success present user, with: Entities::UserPublic |