Browse Source

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

pull/347/head
xxq250 1 year ago
parent
commit
55f60bf062
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      app/controllers/api/v1/projects/compare_controller.rb
  2. +1
    -1
      app/controllers/concerns/api/pull_helper.rb

+ 2
- 2
app/controllers/api/v1/projects/compare_controller.rb 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



+ 1
- 1
app/controllers/concerns/api/pull_helper.rb 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"


Loading…
Cancel
Save