贡献者不存在时只显示邮箱

This commit is contained in:
xxq250 2023-07-18 13:58:14 +08:00
parent f4183a42cf
commit 0c85516a56
1 changed files with 2 additions and 3 deletions

View File

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