Browse Source

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

pull/347/head
xxq250 1 year ago
parent
commit
dff3c9061e
5 changed files with 6 additions and 6 deletions
  1. +1
    -1
      app/controllers/api/v1/issues/journals_controller.rb
  2. +1
    -1
      app/controllers/api/v1/issues_controller.rb
  3. +1
    -1
      app/controllers/mark_files_controller.rb
  4. +2
    -2
      app/controllers/pull_requests_controller.rb
  5. +1
    -1
      app/controllers/reviews_controller.rb

+ 1
- 1
app/controllers/api/v1/issues/journals_controller.rb View File

@@ -46,7 +46,7 @@ class Api::V1::Issues::JournalsController < Api::V1::BaseController
end end


def load_issue def load_issue
@issue = @project.issues.issue_issue.where(project_issues_index: params[:index]).where.not(id: params[:index]).take || Issue.find_by_id(params[:index])
@issue = @project.issues.issue_issue.where(project_issues_index: params[:index]).where.not(id: params[:index]).take || @project.issues.issue_issue.find_by_id(params[:index])
if @issue.blank? if @issue.blank?
render_not_found("疑修不存在!") render_not_found("疑修不存在!")
end end


+ 1
- 1
app/controllers/api/v1/issues_controller.rb View File

@@ -70,7 +70,7 @@ class Api::V1::IssuesController < Api::V1::BaseController
private private


def load_issue def load_issue
@issue = @project.issues.issue_issue.where(project_issues_index: params[:index]).where.not(id: params[:index]).take || Issue.find_by_id(params[:index])
@issue = @project.issues.issue_issue.where(project_issues_index: params[:index]).where.not(id: params[:index]).take || @project.issues.issue_issue.find_by_id(params[:index])
if @issue.blank? if @issue.blank?
render_not_found("疑修不存在!") render_not_found("疑修不存在!")
end end


+ 1
- 1
app/controllers/mark_files_controller.rb View File

@@ -50,7 +50,7 @@ class MarkFilesController < ApplicationController
end end


def load_pull_request def load_pull_request
@pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || PullRequest.find_by_id(params[:id])
@pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || @project.pull_requests.find_by_id(params[:id])
end end


end end

+ 2
- 2
app/controllers/pull_requests_controller.rb View File

@@ -295,11 +295,11 @@ class PullRequestsController < ApplicationController


private private
def load_pull_request def load_pull_request
@pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || PullRequest.find_by_id(params[:id])
@pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || @project.pull_requests.find_by_id(params[:id])
end end


def find_pull_request def find_pull_request
@pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || PullRequest.find_by_id(params[:id])
@pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || @project.pull_requests.find_by_id(params[:id])
@issue = @pull_request&.issue @issue = @pull_request&.issue
if @pull_request.blank? if @pull_request.blank?
normal_status(-1, "合并请求不存在") normal_status(-1, "合并请求不存在")


+ 1
- 1
app/controllers/reviews_controller.rb View File

@@ -14,7 +14,7 @@ class ReviewsController < ApplicationController
end end


def load_pull_request def load_pull_request
@pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || PullRequest.find_by_id(params[:id])
@pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || @project.pull_requests.find_by_id(params[:id])
end end


end end

Loading…
Cancel
Save