fix: detail release version limit
This commit is contained in:
parent
d0a65775aa
commit
ffa2782637
|
@ -1,12 +1,13 @@
|
|||
# Get a list of all commits from a repository
|
||||
class Gitea::Versions::ListService < Gitea::ClientService
|
||||
attr_reader :token, :user_name, :repo
|
||||
attr_reader :token, :user_name, :repo, :args
|
||||
|
||||
# sha: SHA or branch to start listing commits from (usually 'master')
|
||||
def initialize(token, user_name, repo)
|
||||
def initialize(token, user_name, repo, args={})
|
||||
@token = token
|
||||
@user_name = user_name
|
||||
@repo = repo
|
||||
@args = args
|
||||
end
|
||||
|
||||
def call
|
||||
|
@ -16,7 +17,7 @@ class Gitea::Versions::ListService < Gitea::ClientService
|
|||
|
||||
private
|
||||
def params
|
||||
Hash.new.merge(token: token)
|
||||
args.merge(token: token)
|
||||
end
|
||||
|
||||
def url
|
||||
|
|
|
@ -37,7 +37,7 @@ class Repositories::DetailService < ApplicationService
|
|||
end
|
||||
|
||||
def release_suitable
|
||||
releases = Gitea::Versions::ListService.call(@owner.gitea_token, @owner.try(:login), @repo.try(:identifier))
|
||||
releases = Gitea::Versions::ListService.call(@owner.gitea_token, @owner.try(:login), @repo.try(:identifier), {page: 1, limit: 1})
|
||||
releases.is_a?(Hash) && releases[:status] == -1 ? [] : releases
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue