try_api 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9534478c173d1e484e488f3b934c964c7b23c4d6
4
- data.tar.gz: 88e19a1d971b76301655d98ca866e4e4a652ff56
3
+ metadata.gz: 302569a698388c272c2d099ef549b396ad9a05f8
4
+ data.tar.gz: 4c86fce3728fab0c9405587327b614b9a52d2a3a
5
5
  SHA512:
6
- metadata.gz: 7388beb701f29e2285805c9b4c27e7cd32e2f939aa07402e66a06310ebbe0caceb228538c37405e06f7346dc044c483fdc703644d4b299a08c09b35de8a4310f
7
- data.tar.gz: 58fd00c734499d5b93ca6bc80bd14f77941a219776ef112095174d2456fc92be158523a0d043ef011f803efa471e3c809b18a3d0dc45a7d754de4d27269584c9
6
+ metadata.gz: 722ffabb57aa60a06aae2c6d69d57d2c49126b675d944b3b3e2e62b0c466014c2491919e8c5ff05ccfa5f2a721885a15a3b7df2f83c04cf30081306851c7d5f7
7
+ data.tar.gz: 65dd4bf232109fcbebc681c7319593bb2ccbe473fe6fe01cf1495db95921455d87a42d0fda6ee9420aa3ded6d096bb449f58250a94a7cd8eed2a46a6a6d7bc3e
@@ -96,10 +96,13 @@ TryApiApp.controller 'HomeController', [
96
96
 
97
97
  switch method.method.toLowerCase()
98
98
  when 'post', 'delete', 'put'
99
- fd.append 'a', 'a' # TODO sending empty array causes EOFError
100
99
 
101
100
  $.each method.parameters, (i) ->
102
101
  $scope.addParameterToForm fd, this
102
+
103
+ if fd.keys().next().done
104
+ fd = {}
105
+
103
106
  when 'get'
104
107
  url = ''
105
108
  $.each method.parameters, (i) ->
@@ -184,9 +187,11 @@ TryApiApp.controller 'HomeController', [
184
187
  if status = 422
185
188
  alert data.error
186
189
 
187
- $scope.pathBuild = (path, next) ->
190
+ $scope.pathBuild = (path, next = '') ->
191
+ if next
192
+ next = '[' + next + ']'
188
193
  if path
189
- path += '[' + next + ']'
194
+ path += next
190
195
  else
191
196
  path = next
192
197
  return path
@@ -201,7 +206,6 @@ TryApiApp.controller 'HomeController', [
201
206
  form.append path, parameter.value || ''
202
207
 
203
208
  $scope.addArrayToForm = (form, parameter, path = '') ->
204
- form.append 'a', 'a' # TODO sending empty array causes EOFError
205
209
  path = ($scope.pathBuild path, parameter.name) + '[]'
206
210
  $.each parameter.values, ->
207
211
  $.each this, ->
@@ -1,3 +1,3 @@
1
1
  module TryApi
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: try_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Skubenych
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-14 00:00:00.000000000 Z
11
+ date: 2017-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails