emails: move edit email flow to emails controller.

This commit is contained in:
evazion
2020-03-14 17:42:47 -05:00
parent 3dbdce3ae3
commit 167fe51a8a
9 changed files with 89 additions and 98 deletions

View File

@@ -1,19 +0,0 @@
module Maintenance
module User
class EmailChangesController < ApplicationController
def new
end
def create
email_change = UserEmailChange.new(CurrentUser.user, params[:email_change][:email], params[:email_change][:password])
email_change.process
if CurrentUser.user.errors.any?
flash[:notice] = CurrentUser.user.errors.full_messages.join("; ")
redirect_to(new_maintenance_user_email_change_path)
else
redirect_to(edit_user_path(CurrentUser.user.id), :notice => "Email was updated")
end
end
end
end
end