fixed PR中合并来源显示错误,列表

This commit is contained in:
xxq250 2023-08-11 17:33:26 +08:00
parent f0b7618b3d
commit 78b2c80bec
2 changed files with 6 additions and 5 deletions

View File

@ -23,10 +23,10 @@ json.issues do
json.pull_request_base pr.base
json.pull_request_staus pr.status == 1 ? "merged" : (pr.status == 2 ? "closed" : "open")
json.is_original pr.is_original
json.fork_project_id pr&.fork_project_id
json.fork_project_identifier pr&.fork_project&.identifier
json.fork_project_user pr&.fork_project&.owner.try(:login)
json.fork_project_user_name pr&.fork_project&.owner.try(:show_real_name)
json.fork_project_id pr.fork_project_id.present? ? pr.fork_project_id : pr.project_id
json.fork_project_identifier pr.fork_project_id.present? ? pr&.fork_project&.identifier : pr.project&.identifier
json.fork_project_user pr.fork_project_id.present? ? pr&.fork_project&.owner.try(:login) : pr.project&.owner.try(:login)
json.fork_project_user_name pr.fork_project_id.present? ? pr&.fork_project&.owner.try(:show_real_name) : pr.project&.owner.try(:show_real_name)
json.reviewers pr.reviewers.pluck(:login)
json.id issue.id

View File

@ -23,8 +23,9 @@ if @last_review.present?
end
json.pull_request do
json.extract! @pull_request, :id,:base, :head, :status,:fork_project_id, :is_original
json.extract! @pull_request, :id,:base, :head, :status, :is_original
json.pull_request_staus @pull_request.status == 1 ? "merged" : (@pull_request.status == 2 ? "closed" : "open")
json.fork_project_id @pull_request.fork_project_id.present? ? @pull_request.fork_project_id : @pull_request.project_id
json.fork_project_user @pull_request.fork_project_id.present? ? @pull_request&.fork_project&.owner.try(:login) : @pull_request.project&.owner.try(:login)
json.fork_project_user_name @pull_request.fork_project_id.present? ? @pull_request&.fork_project&.owner.try(:show_real_name) : @pull_request.project&.owner.try(:show_real_name)
json.create_user @pull_request&.user&.login