fixed @compare_result null done

This commit is contained in:
xxq250 2023-08-07 15:20:07 +08:00
parent 5fb8c7739f
commit eb860f742a
1 changed files with 13 additions and 11 deletions

View File

@ -1,19 +1,21 @@
json.commits_count @compare_result['CommitsCount']
# json.commits @compare_result['Commits'], partial: 'pull_requests/commit', as: :commit
json.commits do
json.array! @compare_result['Commits'][@page_offset...(@page_offset + @page_limit)] do |commit|
json.author do
json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Committer']), name: commit['Committer']['Name'] }
end
if @compare_result['Commits'].present?
json.array! @compare_result['Commits'][@page_offset...(@page_offset + @page_limit)] do |commit|
json.author do
json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Committer']), name: commit['Committer']['Name'] }
end
json.committer do
json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Committer']), name: commit['Committer']['Name'] }
json.committer do
json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Committer']), name: commit['Committer']['Name'] }
end
json.timestamp render_unix_time(commit['Committer']['When'])
json.time_from_now time_from_now(commit['Committer']['When'])
json.created_at render_format_time_with_date(commit['Committer']['When'])
json.message commit['CommitMessage']
json.sha commit['Sha']
end
json.timestamp render_unix_time(commit['Committer']['When'])
json.time_from_now time_from_now(commit['Committer']['When'])
json.created_at render_format_time_with_date(commit['Committer']['When'])
json.message commit['CommitMessage']
json.sha commit['Sha']
end
end