- RSS フィードを購読する
- トピックを新着としてマーク
- トピックを既読としてマーク
- このスレッドを現在のユーザーにフロートします
- ブックマーク
- 購読
- 印刷用ページ
Catalog.search_catalog_items method return overlapped item objects
The number of items I have is under 200.
But, if code like below is executed,
variable: items would be huge number(endless loop),
and ,items are overlapped many times.
Why?
How can I get uniq item objects?
Please,help me.
(It suppose that the variables:client. location_id have been declered)
items=[]
cursor=nil
loop do
result = client.catalog.search_catalog_items(
body: {
enabled_location_ids: [location_id],
cursor: cursor,
sort_order: "ASC",
product_types: ["REGULAR"]
}
)
if result.success?
items.concat(result.body.items)
break if result.cursor.nil?
cursor = result.cursor
elsif result.error?
raise result.errors
end
end
- 新着としてマーク
- ブックマーク
- 購読
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi @yasunaoizawa, thank you for reaching out.
To better assist you, you can check out our Square Developer Forum or contact our developer support from here.
Thank you!
Square コミュニティ管理者
解決策や有用な回答には、ログイン して ベストアンサーとしてマークをクリックしましょう!
- 新着としてマーク
- ブックマーク
- 購読
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告