add: project branch_slice

This commit is contained in:
2021-09-07 18:39:11 +08:00
parent 1c3ca34efc
commit 91feb8cf89
6 changed files with 67 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
class Gitea::Repository::Branches::ListSliceService < Gitea::ClientService
attr_reader :user, :repo
def initialize(user, repo)
@user = user
@repo = repo
end
def call
response = get(url, params)
render_200_response(response)
end
private
def params
Hash.new.merge(token: user.gitea_token)
end
def url
"/repos/#{user.login}/#{repo}/branches/branches_slice".freeze
end
end