Make limit parameter

This commit is contained in:
Donovan Daniels 2024-10-13 01:26:43 -05:00
parent 624ac2f738
commit 771132f702
Signed by: Donovan_DMC
GPG Key ID: 907D29CBFD6157BA
2 changed files with 5 additions and 2 deletions

View File

@ -71,7 +71,7 @@ module YiffRest
@results = Iqdb.query_image(APIImage.find(@sp[:image_id]), @sc) @results = Iqdb.query_image(APIImage.find(@sp[:image_id]), @sc)
end end
@results ||= [] @results ||= []
@pagy, @images = pagy_array(@results.pluck("image"), size: [1, 2, 2, 1]) @pagy, @images = pagy_array(@results.pluck("image"), max_items: @results.length)
render(:index) render(:index)
end end

View File

@ -2,4 +2,7 @@
require "pagy/extras/bootstrap" require "pagy/extras/bootstrap"
require "pagy/extras/array" require "pagy/extras/array"
Pagy::DEFAULT[:items] = 20 require "pagy/extras/items"
Pagy::DEFAULT[:items] = 25
Pagy::DEFAULT[:items_max] = 250
Pagy::DEFAULT[:items_param] = :limit