Browse Source

fixed 流水线去掉没有流水线的仓库

pull/348/head^2^2
xxq250 1 year ago
parent
commit
0274456442
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      app/controllers/api/pm/pipelines_controller.rb
  2. +1
    -1
      app/views/api/pm/pipelines/index.json.jbuilder

+ 1
- 0
app/controllers/api/pm/pipelines_controller.rb View File

@@ -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


+ 1
- 1
app/views/api/pm/pipelines/index.json.jbuilder View File

@@ -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?


Loading…
Cancel
Save