Browse Source

Merge branch 'develop' into standalone_develop

pull/342/head
yystopf 3 years ago
parent
commit
13d81998fd
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      app/controllers/projects_controller.rb
  2. +2
    -2
      app/controllers/traces/projects_controller.rb

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

@@ -95,7 +95,7 @@ class ProjectsController < ApplicationController

# result = Gitea::Repository::Branches::ListService.call(@owner, @project.identifier)
result = Gitea::Repository::Branches::ListNameService.call(@owner, @project.identifier, params[:name])
@branches = result.is_a?(Hash) ? (result.key?(:status) ? [] : result["branch_name"]) : result
@branches = result.is_a?(Hash) ? (result.key?(:status) ? [] : result) : result
end

def branches_slice


+ 2
- 2
app/controllers/traces/projects_controller.rb View File

@@ -12,7 +12,7 @@ class Traces::ProjectsController < Traces::BaseController
return render_error("无可用检测次数") if @project.user_trace_tasks.size >= 5
return render_error("分支名不能为空!") if branch_name.blank?
@all_branches = Gitea::Repository::Branches::ListNameService.call(@project&.owner, @project.identifier)
return render_error("请输入正确的分支名!") unless @all_branches["branch_name"].include?(branch_name)
return render_error("请输入正确的分支名!") unless @all_branches.include?(branch_name)
code, data, error = Trace::CheckService.call(current_user.trace_token, @project, "1", branch_name)
if code == 200
UserTraceTask.create!(
@@ -51,7 +51,7 @@ class Traces::ProjectsController < Traces::BaseController
branch_name = params[:branch_name]
return render_error("分支名不能为空!") if branch_name.blank?
@all_branches = Gitea::Repository::Branches::ListNameService.call(@project&.owner, @project.identifier)
return render_error("请输入正确的分支名!") unless @all_branches["branch_name"].include?(branch_name)
return render_error("请输入正确的分支名!") unless @all_branches.include?(branch_name)
code, data, error = Trace::ReloadCheckService.call(current_user.trace_token, params[:project_id])
if code == 200
UserTraceTask.create!(


Loading…
Cancel
Save