After repository deletion, the next selected repository is the first one. [SCI-1269]

This commit is contained in:
Matej Zrimšek 2017-06-05 17:56:09 +02:00
parent 419d638163
commit afce3010ef

View file

@ -26,7 +26,7 @@ class RepositoriesController < ApplicationController
flash[:success] = t('repositories.index.delete_flash', flash[:success] = t('repositories.index.delete_flash',
name: @repository.name) name: @repository.name)
@repository.destroy @repository.destroy
redirect_to :back redirect_to team_repositories_path
end end
def rename_modal def rename_modal
@ -53,7 +53,7 @@ class RepositoriesController < ApplicationController
flash[:success] = t('repositories.index.rename_flash', flash[:success] = t('repositories.index.rename_flash',
old_name: old_name, new_name: @repository.name) old_name: old_name, new_name: @repository.name)
render json: { render json: {
url: team_repositories_path(@team, repository: @repository) url: team_repositories_path(repository: @repository)
}, status: :ok }, status: :ok
else else
render json: @repository.errors, status: :unprocessable_entity render json: @repository.errors, status: :unprocessable_entity