From 40d511dbc5ab035d96e33bad1a78b34e41048db2 Mon Sep 17 00:00:00 2001 From: Kenneth Gallego Date: Tue, 22 Jul 2025 17:59:05 +0200 Subject: [PATCH 1/4] Remove duplicated patch --- lib/beyond_api/concerns/connection.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/beyond_api/concerns/connection.rb b/lib/beyond_api/concerns/connection.rb index 1d092bb..3f18aba 100644 --- a/lib/beyond_api/concerns/connection.rb +++ b/lib/beyond_api/concerns/connection.rb @@ -19,15 +19,6 @@ def put(path, body = {}, params = {}) end end - def patch(path, body = {}, params = {}) - handle_request do - agent.patch(path) do |request| - request.params = parse_request(params) - request.body = parse_request(body) - end - end - end - def post(path, body = {}, params = {}) handle_request do agent.post(path) do |request| From a10b0bd13c8e68d28c2e36a307fdb9a8b489f136 Mon Sep 17 00:00:00 2001 From: Kenneth Gallego Date: Tue, 22 Jul 2025 17:59:29 +0200 Subject: [PATCH 2/4] Make camelize_keys to accept more value types --- lib/beyond_api/utils.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/beyond_api/utils.rb b/lib/beyond_api/utils.rb index 3bdf6a1..ca98c29 100644 --- a/lib/beyond_api/utils.rb +++ b/lib/beyond_api/utils.rb @@ -15,8 +15,15 @@ def self.file_content_type(file_path) end end - def self.camelize_keys(hash) - hash.deep_transform_keys { |key| key.to_s.camelize(:lower) } + def self.camelize_keys(input) + case input + when Array + input.map { |item| camelize_keys(item) } + when Hash + input.deep_transform_keys { |key| key.to_s.camelize(:lower) } + else + input + end end def self.faraday_file_parts(file_paths) From f9a87cc47332e336d50ceaa547b284a0aa3a1fdc Mon Sep 17 00:00:00 2001 From: Kenneth Gallego Date: Tue, 22 Jul 2025 18:00:50 +0200 Subject: [PATCH 3/4] Minor documentation fix --- lib/beyond_api/services/product_management/product.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/beyond_api/services/product_management/product.rb b/lib/beyond_api/services/product_management/product.rb index d5736b6..93d5c6d 100644 --- a/lib/beyond_api/services/product_management/product.rb +++ b/lib/beyond_api/services/product_management/product.rb @@ -374,18 +374,19 @@ def remove_tags_from_products(ids, tags) # @see https://developer.epages.com/beyond-docs/#update_variation_properties # # @param id [String] the product UUID - # @param body [Hash] the request body containing variation properties + # @param body [Array] the request body containing variation properties # # @return [Hash] # # @example - # variation_properties = [ + # body = [ # { property: 'salesPrice', enabled: true }, # { property: 'listPrice', enabled: true }, # { property: 'manufacturerPrice', enabled: true }, # { property: 'productIdentifiers', enabled: true }, # { property: 'defaultImage', enabled: true }, # ] + # @client.update_variation_properties('a32ef424-ecc4-4bfc-815b-4f15bb3cffa1', body) def update_variation_properties(id, body) patch("products/#{id}/variation-properties", body) end From 8edcb14bec3bbcf51111a66b9acf4214024287cf Mon Sep 17 00:00:00 2001 From: Kenneth Gallego Date: Wed, 23 Jul 2025 08:09:28 +0200 Subject: [PATCH 4/4] Update lib/beyond_api/utils.rb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- lib/beyond_api/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/beyond_api/utils.rb b/lib/beyond_api/utils.rb index ca98c29..0c58093 100644 --- a/lib/beyond_api/utils.rb +++ b/lib/beyond_api/utils.rb @@ -18,7 +18,7 @@ def self.file_content_type(file_path) def self.camelize_keys(input) case input when Array - input.map { |item| camelize_keys(item) } + input.map(&method(:camelize_keys)) when Hash input.deep_transform_keys { |key| key.to_s.camelize(:lower) } else