lib/sterling/api/client.rb in sterling-1.0.0 vs lib/sterling/api/client.rb in sterling-1.1.0
- old
+ new
@@ -8,12 +8,12 @@
@config = self.verify_config(Sterling.configuration)
@base_url = "#{host}.retailigence.com/v#{version}/"
@conn = Faraday.new(url: "http://#{@base_url}")
end
- def products(user_location, query)
- params = { user_location: user_location, keywords: query }
+ def products(user_location, query, requestor_id)
+ params = { user_location: user_location, keywords: query, requestor_id: requestor_id }
Product.search(self, params)
end
protected
@@ -44,10 +44,10 @@
def invalid_path
{error: 'Invalid path'}
end
def verify_config(config)
- if config.api_version.nil? || config.api_key.nil? || config.api_host.nil? || config.retailer_id.nil?
+ if config.api_version.nil? || config.api_key.nil? || config.api_host.nil?
raise Sterling::Error::MissingAPIConfiguration.new('Invalid configuration')
else
config
end
end