From e25231738a0b48b47aa72d449427daa4c21a7212 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 18 Oct 2022 13:32:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 5ee1fdde3..9f43d1ace 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -147,9 +147,15 @@ class RepositoriesController < ApplicationController end def tags - result = Gitea::Repository::Tags::ListService.call(current_user&.gitea_token, @owner.login, @project.identifier, {page: params[:page], limit: params[:limit]}) + if params[:only_name].present? + result = Gitea::Repository::Tags::ListNameService.call(@owner, @project.identifier, params[:name]) - @tags = result.is_a?(Hash) && result.key?(:status) ? [] : result + @tags = result.is_a?(Hash) && result.key?(:status) ? [] : result + else + result = Gitea::Repository::Tags::ListService.call(current_user&.gitea_token, @owner.login, @project.identifier, {page: params[:page], limit: params[:limit]}) + + @tags = result.is_a?(Hash) && result.key?(:status) ? [] : result + end end def contributors