mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Add some defaults to avoid returning zero values when not supplied in query
This commit is contained in:
@@ -56,7 +56,7 @@ module Api
|
||||
|
||||
@products = product_query.order('created_at DESC').
|
||||
ransack(params[:q]).result.
|
||||
page(params[:page]).per(params[:per_page])
|
||||
page(params[:page] || 1).per(params[:per_page] || 50)
|
||||
|
||||
render_paged_products @products
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user