From 0274456442aec20d9061326e342b4e9478251ab0 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 21 Apr 2025 12:06:02 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E6=B5=81=E6=B0=B4=E7=BA=BF=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E6=B2=A1=E6=9C=89=E6=B5=81=E6=B0=B4=E7=BA=BF=E7=9A=84?= =?UTF-8?q?=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/pm/pipelines_controller.rb | 1 + app/views/api/pm/pipelines/index.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/pm/pipelines_controller.rb b/app/controllers/api/pm/pipelines_controller.rb index f8f073c96..fe94fd86f 100644 --- a/app/controllers/api/pm/pipelines_controller.rb +++ b/app/controllers/api/pm/pipelines_controller.rb @@ -69,6 +69,7 @@ class Api::Pm::PipelinesController < Api::Pm::BaseController @pipelines = Action::Pipeline.where(project_id: @project_ids).order(updated_at: :desc) @pipelines = @pipelines.where("pipeline_name like ?", "%#{params[:pipeline_name]}%") if params[:pipeline_name].present? @pipelines = @pipelines.where(pipeline_type: params[:pipeline_type]) if params[:pipeline_type].present? + @has_pipeline_ids = @pipelines.pluck(:project_id) @pipelines = @pipelines @pipelines = paginate @pipelines end diff --git a/app/views/api/pm/pipelines/index.json.jbuilder b/app/views/api/pm/pipelines/index.json.jbuilder index 975d36314..c7ee9e545 100644 --- a/app/views/api/pm/pipelines/index.json.jbuilder +++ b/app/views/api/pm/pipelines/index.json.jbuilder @@ -1,6 +1,6 @@ json.status 0 json.message "success" -json.projects @project_ids.each do |project_id| +json.projects @has_pipeline_ids.each do |project_id| json.id project_id project = Project.find_by(id: project_id) if project.present?