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:
Matt-Yorkley
2021-06-29 12:00:26 +01:00
parent b3c4a38b0f
commit e5afa3a26e
2 changed files with 2 additions and 2 deletions

View File

@@ -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,

View File

@@ -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