mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Deal with Api::OrdersController and SearchOrders service
This commit is contained in:
@@ -15,9 +15,11 @@ module Api
|
||||
|
||||
orders = SearchOrders.new(params, current_api_user).orders
|
||||
|
||||
pagy, paged_orders = pagy(orders, items: params[:per_page] || default_per_page)
|
||||
|
||||
render json: {
|
||||
orders: serialized_orders(orders),
|
||||
pagination: pagination_data(orders)
|
||||
orders: serialized_orders(paged_orders),
|
||||
pagination: pagination_data(pagy)
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user