diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 52c776477..2d9ddc014 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -94,7 +94,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 diff --git a/app/controllers/traces/projects_controller.rb b/app/controllers/traces/projects_controller.rb index 74e683f85..1377b4522 100644 --- a/app/controllers/traces/projects_controller.rb +++ b/app/controllers/traces/projects_controller.rb @@ -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!(