Only return empty builds hash when there are no ids present.

This commit is contained in:
Mathias Meyer 2013-08-22 14:59:19 +02:00
parent 3a90f08d3b
commit c711002577

View File

@ -4,19 +4,16 @@ class Travis::Api::App
class Endpoint class Endpoint
class Builds < Endpoint class Builds < Endpoint
get '/' do get '/' do
if params[:branches] 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(:find_branches, params)
if params['ids'].empty?
respond_with({})
else else
respond_with {} respond_with service(name, params)
end end
# name = params[:branches] ? :find_branches : :find_builds
# params['ids'] = params['ids'].split(',') if params['ids'].respond_to?(:split)
# respond_with service(name, params)
end end
get '/:id' do
respond_with service(:find_build, params)
end end
post '/:id/cancel' do post '/:id/cancel' do