mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 19:51:01 +08:00
Improve repositories loading for archive/restore [SCI-4780]
This commit is contained in:
parent
29f62419bd
commit
8e0ed286fb
1 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue