Skip to content

Commit

Permalink
Merge pull request #71 from TheMeier/puppet_533_compat
Browse files Browse the repository at this point in the history
use nil instead of false for pagination: next
  • Loading branch information
i11 authored Nov 8, 2017
2 parents 48b8c42 + e1d8250 commit 530bf6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/puppet_forge_server/app/version3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def initialize(backends)
halt 400, json({:error => 'The number of version constraints in the query does not match the number of module names'}) unless params[:module]
author, name = params[:module].split '-'
releases = releases(author, name)
halt 200, json({:pagination => {:next => false}, :results => []}) unless releases
json :pagination => {:next => false, :total => releases.count}, :results => releases
halt 200, json({:pagination => {:next => nil}, :results => []}) unless releases
json :pagination => {:next => nil, :total => releases.count}, :results => releases
end

get '/v3/files/*' do
Expand Down Expand Up @@ -86,8 +86,8 @@ def initialize(backends)
backend.query_metadata(query)
end.flatten.compact.uniq
modules = metadata.empty? ? nil : get_modules(metadata)
halt 200, json({:pagination => {:next => false}, :results => []}) unless modules
json :pagination => {:next => false, :total => modules.count}, :results => modules
halt 200, json({:pagination => {:next => nil}, :results => []}) unless modules
json :pagination => {:next => nil, :total => modules.count}, :results => modules
end

get '/v3/users/:author' do
Expand Down

0 comments on commit 530bf6a

Please sign in to comment.