From f0622b62619da35a3d1f161b8903af79814adc61 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 7 May 2024 14:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E8=A7=A6=E5=8F=91we?= =?UTF-8?q?bhook=E6=96=B0=E5=8A=A0=E5=8F=82=E6=95=B0=E4=BB=A5=E5=8C=BA?= =?UTF-8?q?=E5=88=AB=E4=B8=8D=E5=90=8C=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/v1/projects/sync_repositories_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/projects/sync_repositories_controller.rb b/app/controllers/api/v1/projects/sync_repositories_controller.rb index 96e14faf..bd7bc204 100644 --- a/app/controllers/api/v1/projects/sync_repositories_controller.rb +++ b/app/controllers/api/v1/projects/sync_repositories_controller.rb @@ -24,7 +24,11 @@ class Api::V1::Projects::SyncRepositoriesController < Api::V1::BaseController def sync return render_error("请输入正确的同步方向!") if params[:sync_direction].blank? - @sync_repositories = SyncRepository.where(project: @project, sync_direction: params[:sync_direction]) + if params[:repo_type].present? + @sync_repositories = SyncRepository.where(project: @project, type: params[:repo_type], sync_direction: params[:sync_direction]) + else + @sync_repositories = SyncRepository.where(project: @project, sync_direction: params[:sync_direction]) + end @sync_repository_branches = SyncRepositoryBranch.where(sync_repository_id: @sync_repositories, enable: true) # 全部分支同步暂时不做 # @sync_repositories.each do |item|