新增:贡献者分页

This commit is contained in:
2023-03-22 18:57:56 +08:00
parent ec85b80a98
commit 3762a54eff
3 changed files with 24 additions and 8 deletions

View File

@@ -166,8 +166,9 @@ class RepositoriesController < ApplicationController
if params[:filepath].present? || @project.educoder?
@contributors = []
else
result = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier)
@contributors = result.is_a?(Hash) && result.key?(:status) ? [] : result
result = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier, {page: params[:page], limit: params[:limit]})
@total_count = result[:total_count]
@contributors = result.is_a?(Hash) ? result[:body] : []
end
rescue
@contributors = []