diff options
author | Rémy Coutable <remy@rymai.me> | 2018-02-16 15:10:22 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-02-27 16:02:22 +0100 |
commit | 1c88d92b3fe174a56080575a14d6b473f17f7d8f (patch) | |
tree | 7150c48b368e82d70f6bfc228c3d836c7be7c3ac /lib/api/members.rb | |
parent | e82f629be4b9c91e2611095cd4296e487ed137ef (diff) | |
download | gitlab-ce-1c88d92b3fe174a56080575a14d6b473f17f7d8f.tar.gz |
Improve Member servicesrc/reduce-delta-with-ce-in-controllers-ce
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api/members.rb')
-rw-r--r-- | lib/api/members.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/api/members.rb b/lib/api/members.rb index 6367cde04bb..8b12986d09e 100644 --- a/lib/api/members.rb +++ b/lib/api/members.rb @@ -83,11 +83,9 @@ module API member = source.members.find_by!(user_id: params[:user_id]) updated_member = - ::Members::UpdateService.new( - source, - current_user, - declared_params(include_missing: false) - ).execute(member) + ::Members::UpdateService + .new(current_user, declared_params(include_missing: false)) + .execute(member) if updated_member.valid? present updated_member, with: Entities::Member @@ -105,7 +103,7 @@ module API member = source.members.find_by!(user_id: params[:user_id]) destroy_conditionally!(member) do - ::Members::DestroyService.new(source, current_user).execute(member) + ::Members::DestroyService.new(current_user).execute(member) end end end |