beyond_api 0.16.0.pre → 0.16.1.pre

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
  SHA256:
3
- metadata.gz: a6c559696ebb3e320f0eba53263a1a2e4e1f6122abbee3abb0f9dcdcae0ed51c
4
- data.tar.gz: aed55ba3c13a04013d7aa4e7c4fcdea9252f1c93623b982eac53fa8557b098d8
3
+ metadata.gz: e21d3e55d80fdab110e763b80945554aaa37db10d9cd1d6420e1048992990442
4
+ data.tar.gz: abfb64188b9e2b04a223b7cbc839eec16b2f6307ecccf0a8c6b484ab55259231
5
5
  SHA512:
6
- metadata.gz: 7791a721f9b5e8a27e574d93274249e0a7240f2bb2400de235d8d3ab89a07ac133fe15aad399b9af9b305a28e36091f61d3d1fff493bb02e2b30b720955d0947
7
- data.tar.gz: 7363458296810b56dbcf80e220a2aad5c04a27c66b1f51e4485a9667ef671368aab1e8ed354b7d8692a4248dfc7ec41fd8bb2c66dc43f2015d5492a14cb8b255
6
+ metadata.gz: 9a51c07ca44a5f137e8c2cea3e3249e607323ec9a58a661895d4541ccd573d234c72fae261632341e8e44077a8eca1f34e0748cad693961e4195e0c6b881089a
7
+ data.tar.gz: 64b13f1fa84d4292c6f414071dd64beed61acddcefff7c8aa952cc089e53bf519d8823e7ad9ebf98cfb779fb60855411c603c435b07a5c74caa07a9a243a3ac3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### v0.16.1.pre
2
+
3
+ * bug-fixes
4
+ * Fix method to retrieve resources without pagination
5
+
1
6
  ### v0.16.0.pre
2
7
 
3
8
  * features
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- beyond_api (0.16.0.pre)
4
+ beyond_api (0.16.1.pre)
5
5
  faraday (~> 0.15)
6
6
 
7
7
  GEM
@@ -45,14 +45,17 @@ module BeyondApi
45
45
  end
46
46
 
47
47
  def handle_all_request(url, resource, params = {})
48
+
48
49
  if params[:paginated] == false
49
- result = all_paginated(url, { page: 0, size: 1000 })
50
+ result = all_paginated(url, params.merge(page: 0, size: 1000))
50
51
 
51
52
  (1..result[:page][:total_pages] - 1).each do |page|
52
- result[:embedded][resource].concat(all_paginated(url, { page: page, size: 1000 })[:embedded][resource])
53
+ result[:embedded][resource].concat(all_paginated(url, params.merge(page: page, size: 1000))[:embedded][resource])
53
54
  end
54
55
 
55
- result.is_a?(Hash) ? result.delete(:page) : result.delete_field(:page)
56
+ result[:page][:size] = result[:page][:total_elements]
57
+ result[:page][:total_pages] = 1
58
+ result[:page][:number] = 0
56
59
 
57
60
  result
58
61
  else
@@ -1,3 +1,3 @@
1
1
  module BeyondApi
2
- VERSION = "0.16.0.pre".freeze
2
+ VERSION = "0.16.1.pre".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0.pre
4
+ version: 0.16.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unai Abrisketa
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-06-24 00:00:00.000000000 Z
13
+ date: 2021-07-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler