add: name query for branches

This commit is contained in:
2022-04-26 17:15:59 +08:00
parent fc3cf01d3f
commit 088c617cc1
6 changed files with 16 additions and 13 deletions

View File

@@ -88,7 +88,7 @@ class ProjectsController < ApplicationController
return @branches = [] unless @project.forge?
# result = Gitea::Repository::Branches::ListService.call(@owner, @project.identifier)
result = Gitea::Repository::Branches::ListNameService.call(@owner, @project.identifier)
result = Gitea::Repository::Branches::ListNameService.call(@owner, @project.identifier, params[:name])
@branches = result.is_a?(Hash) ? (result.key?(:status) ? [] : result["branch_name"]) : result
end