fixed 代码贡献者email

This commit is contained in:
xxq250 2023-01-06 11:16:50 +08:00
parent a274fa913d
commit 7c80f74e26
2 changed files with 23 additions and 1 deletions

View File

@ -6,7 +6,7 @@ json.deletions @result_object["deletions"]
json.commit_count_in_all_branches @result_object["commit_count_in_all_branches"]
json.authors @result_object["authors"].each do |author|
json.author do
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(author), name: author['name'] }
json.partial! 'api/v1/users/commit_user_email', locals: { user: render_cache_commit_author(author), name: author['name'], email: author['email'] }
end
json.commits author["commits"]
json.additions author["additions"]

View File

@ -0,0 +1,22 @@
if user.present?
if user.is_a?(Hash)
json.id user["id"]
json.login user["login"]
json.name user["name"]
json.type user["type"]
json.image_url user["avatar_url"]
else
json.id user.id
json.login user.login
json.name user.real_name
json.type user&.type
json.image_url url_to_avatar(user)
end
else
json.id nil
json.login name
json.name name
json.email email
json.type nil
json.image_url User::Avatar.get_letter_avatar_url(name)
end