mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-18 05:20:54 +08:00
Fix repository_row call when no repository row is selected [SCI-8281] (#5301)
This commit is contained in:
parent
db15297090
commit
9b49745194
2 changed files with 3 additions and 3 deletions
|
@ -65,7 +65,7 @@
|
|||
$('#modal-info-repository-row').modal('hide');
|
||||
PrintModalComponent.row_ids = selectedRows;
|
||||
} else {
|
||||
PrintModalComponent.row_ids = RepositoryDatatable.selectedRows();
|
||||
PrintModalComponent.row_ids = [...RepositoryDatatable.selectedRows()];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -307,8 +307,8 @@ class RepositoryRowsController < ApplicationController
|
|||
end
|
||||
|
||||
def load_repository_or_snapshot
|
||||
@repository = Repository.accessible_by_teams(current_team).find_by(id: @repository_row.first.repository_id)
|
||||
@repository ||= RepositorySnapshot.find_by(id: @repository_row.first.repository_id)
|
||||
@repository = Repository.accessible_by_teams(current_team).find_by(id: @repository_row&.first&.repository_id)
|
||||
@repository ||= RepositorySnapshot.find_by(id: @repository_row&.first&.repository_id)
|
||||
|
||||
render_404 unless @repository
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue