mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-22 05:18:51 +00:00
Improve pagination data in bulk products
This commit is contained in:
@@ -118,7 +118,15 @@ module Api
|
||||
each_serializer: Api::Admin::ProductSerializer
|
||||
)
|
||||
|
||||
render text: { products: serializer, pages: products.num_pages }.to_json
|
||||
render text: {
|
||||
products: serializer,
|
||||
pagination: {
|
||||
results: products.total_count,
|
||||
pages: products.num_pages,
|
||||
page: params[:page].to_i,
|
||||
per_page: params[:per_page].to_i
|
||||
}
|
||||
}.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user