Skip to content

Commit

Permalink
Fix POST
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Decot committed Aug 14, 2019
1 parent d41be5e commit 87281dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 3 additions & 1 deletion lib/app_store_connect/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ def http_body(web_service_endpoint, **kwargs)
"AppStoreConnect::#{web_service_endpoint.http_body_type}"
.constantize
.new(**kwargs)
.to_h
.deep_transform_keys { |k| k.to_s.camelize(:lower) }
.to_json
end

def post(web_service_endpoint, **kwargs, &block)
Request.new(
request = Request.new(
web_service_endpoint: web_service_endpoint,
kwargs: kwargs,
http_method: :post,
Expand Down
6 changes: 1 addition & 5 deletions lib/app_store_connect/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ def headers
def body
return if http_method == :get

@options
.fetch(:request)
.to_h
.deep_transform_keys { |k| k.to_s.camelize(:lower) }
.to_json
@options.fetch(:http_body)
end

def url_parameter_names(web_service_endpoint)
Expand Down

0 comments on commit 87281dd

Please sign in to comment.