~singpolyma/whiplash-mboa

c8768e218e669d3308adc9f42b15e8bd6a62c079 — Stephen Paul Weber 1 year, 9 months ago 31edcac
Apparently results can be nil too
1 files changed, 1 insertions(+), 0 deletions(-)

M app/controllers/fulfillment_controller.rb
M app/controllers/fulfillment_controller.rb => app/controllers/fulfillment_controller.rb +1 -0
@@ 12,6 12,7 @@ class FulfillmentController < ApplicationController

	def fetch_all_items(page: 1)
		results = WHIPLASH_HTTP.get("items", { page: page, limit: 1000 }, "X-API-KEY" => @shop.whiplash_api_key).body
		return [] unless results
		return results if results.empty?

		results + fetch_all_items(page: page + 1)