Commit 968809dc authored by James Lopez's avatar James Lopez

fix profiles controller

parent aa158dd7
......@@ -14,7 +14,7 @@ class ProfilesController < Profiles::ApplicationController
respond_to do |format|
result = Users::UpdateService.new(current_user, @user, user_params).execute
if result[:success]
if result[:status] == :success
message = "Profile was successfully updated"
format.html { redirect_back_or_default(default: { action: 'show' }, options: { notice: message }) }
......@@ -65,7 +65,7 @@ class ProfilesController < Profiles::ApplicationController
def update_username
result = Users::UpdateService.new(current_user, @user, username: user_params[:username]).execute
options = if result[:success]
options = if result[:status] == :success
{ notice: "Username successfully changed" }
else
{ alert: "Username change failed - #{result[:message]}" }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment