From 4046ddf2ca5ed55c5d22accb3fa792af6befb50c Mon Sep 17 00:00:00 2001 From: BrunoChauvet Date: Wed, 11 Oct 2017 14:53:00 +1100 Subject: [PATCH] fetch all products when displaying marketplace --- .../concerns/controllers/jpi/v1/admin/products_controller.rb | 2 +- .../concerns/controllers/jpi/v1/products_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/lib/mno_enterprise/concerns/controllers/jpi/v1/admin/products_controller.rb b/api/lib/mno_enterprise/concerns/controllers/jpi/v1/admin/products_controller.rb index d77c66fb4..70a4d5b42 100644 --- a/api/lib/mno_enterprise/concerns/controllers/jpi/v1/admin/products_controller.rb +++ b/api/lib/mno_enterprise/concerns/controllers/jpi/v1/admin/products_controller.rb @@ -17,7 +17,7 @@ def index response.headers['X-Total-Count'] = @products.count else query = MnoEnterprise::Product.apply_query_params(params).includes(DEPENDENCIES) - @products = query.to_a + @products = MnoEnterprise::Product.fetch_all(query) response.headers['X-Total-Count'] = query.meta.record_count end end diff --git a/api/lib/mno_enterprise/concerns/controllers/jpi/v1/products_controller.rb b/api/lib/mno_enterprise/concerns/controllers/jpi/v1/products_controller.rb index f55174bf5..183da759e 100644 --- a/api/lib/mno_enterprise/concerns/controllers/jpi/v1/products_controller.rb +++ b/api/lib/mno_enterprise/concerns/controllers/jpi/v1/products_controller.rb @@ -15,7 +15,7 @@ def index query = query.with_params(_metadata: { organization_id: parent_organization.id }) end - @products = query.to_a + @products = MnoEnterprise::Product.fetch_all(query) response.headers['X-Total-Count'] = query.meta.record_count end