Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop

This commit is contained in:
xxq250 2024-11-18 17:25:03 +08:00
commit 55f60bf062
2 changed files with 3 additions and 3 deletions

View File

@ -20,9 +20,9 @@ class Api::V1::Projects::CompareController < Api::V1::BaseController
def gitea_compare_files(base, head)
if params[:filepath].present?
$gitea_hat_client.get_repos_compare_files_by_owner_repo_baseref_headref_filepath(@project&.owner&.login, @project.identifier, Addressable::URI.escape(base), Addressable::URI.escape(head), CGI.escape(params[:filepath]), {query: {token: current_user&.gitea_token}})
$gitea_hat_client.get_repos_compare_by_owner_repo_baseref_headref(@project&.owner&.login, @project.identifier, Addressable::URI.escape(base), Addressable::URI.escape(head), {query: {token: current_user&.gitea_token, isFiles: true, filepath: params[:filepath]}})
else
$gitea_hat_client.get_repos_compare_files_by_owner_repo_baseref_headref(@project&.owner&.login, @project.identifier, Addressable::URI.escape(base), Addressable::URI.escape(head), {query: {page:page,limit:limit,token: current_user&.gitea_token}})
$gitea_hat_client.get_repos_compare_by_owner_repo_baseref_headref(@project&.owner&.login, @project.identifier, Addressable::URI.escape(base), Addressable::URI.escape(head), {query: {page:page,limit:limit,token: current_user&.gitea_token, isFiles: true}})
end
end

View File

@ -3,7 +3,7 @@ module Api::PullHelper
def load_pull_request
pull_request_id = params[:pull_id] || params[:id]
@pull_request = @project.pull_requests.where(gitea_number: pull_request_id).where.not(id: pull_request_id).take || PullRequest.find_by_id(pull_request_id)
@pull_request = @project.pull_requests.where(gitea_number: pull_request_id).where.not(id: pull_request_id).take || @project.pull_requests.find_by_id(pull_request_id)
@issue = @pull_request&.issue
if @pull_request
logger.info "###########pull_request founded"