更改:compare接口

This commit is contained in:
yystopf 2023-11-30 17:02:27 +08:00
parent a0265d4808
commit 026d58c347
2 changed files with 6 additions and 2 deletions

View File

@ -29,6 +29,6 @@ class Api::V1::Projects::CompareService < ApplicationService
end end
def load_gitea_data def load_gitea_data
@gitea_data = $gitea_client.get_repos_compare_by_owner_repo_from_to(owner, repo, from, to, {query: request_params}) rescue nil @gitea_data = $gitea_hat_client.get_repos_compare_by_owner_repo_baseref_headref(owner, repo, to, from, {query: request_params}) rescue nil
end end
end end

View File

@ -14,5 +14,9 @@ json.commits @result_object['Commits'] do |commit|
json.parent_shas commit['Sha']['ParentShas'] json.parent_shas commit['Sha']['ParentShas']
end end
json.diff do json.diff do
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object['Diff'] if @result_object['Diff'].present?
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object['Diff']
else
json.nil!
end
end end