mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Simplify #pagy calls without default item counts
Pagy will pick up the :per_page param by default now, so we don't need to specify `items: params[:per_page]` unless we want to use something beyond that param's value.
This commit is contained in:
@@ -16,7 +16,7 @@ module Admin
|
||||
reorder('spree_line_items.order_id ASC, spree_line_items.id ASC')
|
||||
|
||||
pagy = nil
|
||||
pagy, @line_items = pagy(@line_items, items: params[:per_page]) if pagination_required?
|
||||
pagy, @line_items = pagy(@line_items) if pagination_required?
|
||||
|
||||
render json: {
|
||||
line_items: serialized_line_items,
|
||||
|
||||
@@ -32,7 +32,7 @@ module Api
|
||||
includes(:country).order('name ASC')
|
||||
|
||||
if pagination?
|
||||
_pagy, states = pagy(states, items: params[:per_page])
|
||||
_pagy, states = pagy(states)
|
||||
end
|
||||
|
||||
states
|
||||
|
||||
Reference in New Issue
Block a user