更改:compare接口
This commit is contained in:
parent
a0265d4808
commit
026d58c347
|
@ -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
|
|
@ -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
|
||||||
|
if @result_object['Diff'].present?
|
||||||
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object['Diff']
|
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object['Diff']
|
||||||
|
else
|
||||||
|
json.nil!
|
||||||
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue