Use follower for /builds and /jobs

This commit is contained in:
Piotr Sarnacki 2013-09-03 14:45:12 +02:00
parent 10b17e6e06
commit d133528893
2 changed files with 8 additions and 4 deletions

View File

@ -4,10 +4,12 @@ class Travis::Api::App
class Endpoint class Endpoint
class Builds < Endpoint class Builds < Endpoint
get '/' do get '/' do
prefer_follower do
name = params[:branches] ? :find_branches : :find_builds name = params[:branches] ? :find_branches : :find_builds
params['ids'] = params['ids'].split(',') if params['ids'].respond_to?(:split) params['ids'] = params['ids'].split(',') if params['ids'].respond_to?(:split)
respond_with service(name, params) respond_with service(name, params)
end end
end
get '/:id' do get '/:id' do
respond_with service(:find_build, params) respond_with service(:find_build, params)

View File

@ -4,8 +4,10 @@ class Travis::Api::App
class Endpoint class Endpoint
class Jobs < Endpoint class Jobs < Endpoint
get '/' do get '/' do
prefer_follower do
respond_with service(:find_jobs, params) respond_with service(:find_jobs, params)
end end
end
get '/:id' do get '/:id' do
respond_with service(:find_job, params) respond_with service(:find_job, params)