fixed: 返回错误跳转地址

This commit is contained in:
yystopf 2025-06-25 16:44:44 +08:00
parent 8cab37587e
commit 2a0ce2972a
1 changed files with 2 additions and 2 deletions

View File

@ -17,9 +17,9 @@ class Api::V1::Projects::Pulls::PullsController < Api::V1::BaseController
can_merge = @project&.pull_requests.where(head: @pull_request.head, base: @pull_request.base, status: 0, is_original: @pull_request.is_original, fork_project_id: @pull_request.fork_project_id)
if can_merge.present?
render json: {
status: -2,
status: -1,
redirect_url:"/#{@project.owner.login}/#{@project.identifier}/pulls/#{can_merge.first.gitea_number}",
message: "在这些分支之间的合并请求已存在<a href='/#{@project.owner.login}/#{@project.identifier}/pulls/#{can_merge.first.gitea_number}''>#{can_merge.first.try(:title)}</a>",
message: "在这些分支之间的合并请求已存在",
}
else
@result_object = Api::V1::Projects::Pulls::ReopenService.call(@project, @pull_request, current_user)