mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Update conditional pagination in Api::OrdersController
This commit is contained in:
@@ -15,10 +15,10 @@ module Api
|
||||
|
||||
orders = SearchOrders.new(params, current_api_user).orders
|
||||
|
||||
@pagy, paged_orders = pagy(orders, items: params[:per_page] || default_per_page)
|
||||
@pagy, orders = pagy(orders, items: params[:per_page] || default_per_page) if pagination_required?
|
||||
|
||||
render json: {
|
||||
orders: serialized_orders(paged_orders),
|
||||
orders: serialized_orders(orders),
|
||||
pagination: pagination_data
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user