update routes for builds
This commit is contained in:
parent
fe9a6536d7
commit
f7634f0f39
|
@ -3,11 +3,5 @@ module Travis::API::V3
|
|||
def find(repository)
|
||||
repository.builds
|
||||
end
|
||||
|
||||
def count(repository, time_frame)
|
||||
find(repository).
|
||||
where(event_type: 'api'.freeze, result: 'accepted'.freeze).
|
||||
where('created_at > ?'.freeze, time_frame.ago).count
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -28,6 +28,11 @@ module Travis::API::V3
|
|||
post :create
|
||||
end
|
||||
|
||||
resource :builds do
|
||||
route '/builds'
|
||||
get :find
|
||||
end
|
||||
|
||||
resource :branch do
|
||||
route '/branch/{branch.name}'
|
||||
get :find
|
||||
|
@ -39,11 +44,6 @@ module Travis::API::V3
|
|||
get :for_current_user
|
||||
end
|
||||
|
||||
resource :builds do
|
||||
route '/builds'
|
||||
get :find
|
||||
end
|
||||
|
||||
resource :build do
|
||||
capture id: :digit
|
||||
route '/build/{build.id}'
|
||||
|
|
Loading…
Reference in New Issue
Block a user