diff options
author | James Lopez <james@jameslopez.es> | 2017-06-22 08:55:07 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-06-23 11:41:42 +0200 |
commit | 785cbb79e255c8369ca5eb916207304f39d188ad (patch) | |
tree | abd792d12be1f35d868db591793311eb32d92370 /app/controllers/admin | |
parent | 0c8e7f49d1ef32ed5ea1bdd7e26dd5e169bad359 (diff) | |
download | gitlab-ce-785cbb79e255c8369ca5eb916207304f39d188ad.tar.gz |
refactor emails service
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/users_controller.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 4c43d12d317..065ebf81793 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -136,7 +136,7 @@ class Admin::UsersController < Admin::ApplicationController # restore username to keep form action url. user.username = params[:id] format.html { render "edit" } - format.json { render json: result[:message], status: result[:status] } + format.json { render json: [result[:message]], status: result[:status] } end end end @@ -152,11 +152,7 @@ class Admin::UsersController < Admin::ApplicationController def remove_email email = user.emails.find(params[:email_id]) - Emails::DestroyService.new(current_user, self, email: email.email).execute - - result = Users::UpdateService.new(current_user, @user).execute do |user| - user.update_secondary_emails! - end + Emails::DestroyService.new(current_user, user, email: email.email).execute respond_to do |format| if result[:status] == :success |