Skip to content

Commit

Permalink
Rename destroy.js.erb file to flash.js.erb
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kang committed Sep 4, 2019
1 parent 51ccc38 commit 46b54b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/api/app/controllers/webui/groups/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def destroy

if @group.remove_user(@user)
flash.now[:success] = "Removed user from group '#{@group}'"
render 'webui2/webui/webui/flash', status: :ok
render 'flash', status: :ok
else
render 'webui2/webui/webui/flash', status: :bad_request
render 'flash', status: :bad_request
end
end

Expand All @@ -46,15 +46,15 @@ def update
group_maintainer = GroupMaintainer.create(user: @user, group: @group)
if group_maintainer.valid?
flash.now[:success] = "Gave maintainer rights to '#{@user}'"
render 'webui2/webui/webui/flash', status: :ok
render 'flash', status: :ok
else
flash.now[:error] = "Couldn't make user '#{user}' maintainer: #{group_maintainer.errors.full_messages.to_sentence}"
render 'webui2/webui/webui/flash', status: :bad_request
render 'flash', status: :bad_request
end
else
@group.group_maintainers.where(user: @user).destroy_all
flash.now[:success] = "Removed maintainer rights from '#{@user}'"
render 'webui2/webui/webui/flash', status: :ok
render 'flash', status: :ok
end
end

Expand All @@ -65,15 +65,15 @@ def set_group
return if @group

flash.now[:error] = "Group '#{params[:group_title]}' not found"
render 'webui2/webui/webui/flash', status: :not_found
render 'flash', status: :not_found
end

def set_user
@user = @group.users.find_by(login: params[:user_login])
return if @user

flash.now[:error] = "User '#{params[:user_login]}' not found in group '#{@group}'"
render 'webui2/webui/webui/flash', status: :not_found
render 'flash', status: :not_found
end
end
end
Expand Down

0 comments on commit 46b54b7

Please sign in to comment.