|
|
|
@ -277,7 +277,7 @@ class PullRequestsController < ApplicationController
|
|
|
|
|
MergeTitleField: params[:title]
|
|
|
|
|
}
|
|
|
|
|
merge_pr = Gitea::PullRequest::MergeService.new(current_user, @repository.try(:identifier), @pull_request.try(:gpid), requests_params).call
|
|
|
|
|
if @pull_request.update_attribute(:status, 1) && merge_pr
|
|
|
|
|
if @pull_request.update_attribute(:status, 1) && merge_pr[:status].to_i == 200
|
|
|
|
|
# @pull_request.project_trends.create(user_id: current_user.id, project_id: @project.id, action_type: "merge")
|
|
|
|
|
@pull_request&.project_trends&.update_all(action_type: "close")
|
|
|
|
|
|
|
|
|
@ -380,9 +380,7 @@ class PullRequestsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def find_pull_request
|
|
|
|
|
Rails.logger.info("#########___________#######{params[:id]}")
|
|
|
|
|
@pull_request = PullRequest.find_by_id(params[:id])
|
|
|
|
|
Rails.logger.info("#########________@pull_request___#######{@pull_request}")
|
|
|
|
|
@issue = @pull_request&.issue
|
|
|
|
|
if @pull_request.blank?
|
|
|
|
|
normal_status(-1, "合并请求不存在")
|
|
|
|
|