diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 5a7e565d9..65000e671 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -11,7 +11,8 @@ class RepositoriesController < ApplicationController before_action :switch_team_with_param, only: :show before_action :load_repository, except: %i(index create create_modal sidebar archive restore) before_action :load_repositories, only: %i(index show sidebar) - before_action :load_repositories_for_archiving, only: %i(archive restore) + before_action :load_repositories_for_archiving, only: :archive + before_action :load_repositories_for_restoring, only: :restore before_action :check_view_all_permissions, only: %i(index sidebar) before_action :check_view_permissions, except: %i(index create_modal create update destroy parse_sheet import_records sidebar archive restore) before_action :check_manage_permissions, only: %i(destroy destroy_modal rename_modal update) @@ -383,7 +384,11 @@ class RepositoriesController < ApplicationController end def load_repositories_for_archiving - @repositories = current_team.repositories.where(id: params[:repository_ids]) + @repositories = current_team.repositories.active.where(id: params[:repository_ids]) + end + + def load_repositories_for_restoring + @repositories = current_team.repositories.archived.where(id: params[:repository_ids]) end def set_inline_name_editing