diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 5ee1fdde..9f43d1ac 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