Merge pull request #5 from ezaki3/fix-get-variations-items-empty

Fix get_variations items is empty
This commit is contained in:
Dan Milne
2020-02-17 10:28:40 +11:00
committed by GitHub

View File

@@ -10,6 +10,7 @@ module Paapi
@items_data = @hash.dig('ItemsResult', 'Items') @items_data = @hash.dig('ItemsResult', 'Items')
@items_data ||= @hash.dig('SearchResult', 'Items') @items_data ||= @hash.dig('SearchResult', 'Items')
@items_data ||= @hash.dig('VariationsResult', 'Items')
@items_data ||= [] @items_data ||= []
@items = @items_data.map {|d| Item.new(d)} @items = @items_data.map {|d| Item.new(d)}