uc3-dmp-api-core 0.0.9 → 0.0.10

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: 5ccb9f74dc7a84cce5b0d2efb7c4755c856d8b3dde24d0fb5d2e8576d3ccd6dc
4
- data.tar.gz: 93aab052eb9761a83c3e27a92d25d863473c3b2d121266d1826e136977f1e482
3
+ metadata.gz: 63205a96813c40c4f0b7969dc629d998c263187277748bc1d934ff62f6a35fe4
4
+ data.tar.gz: ad1dfc82eb0fc361ca63b2acf2cc898f7cf8749f4fee9e9b43d8c1e7aa8827c5
5
5
  SHA512:
6
- metadata.gz: 2d08ab473241901017b84572788b7618b6a6d73d2a23208e799c405182190d75fc3a88573d83f4268d037f3d388505a36f7818bd3c403f4878ac2ca8b033c9e0
7
- data.tar.gz: 7b5274264db61d0781238f777b0cba675cbcd36656128a2b5ee32e52696bfa35a6538a78bf49e69bf8a0108de5ac29761a212cc6936273a2ec4b4702ba070015
6
+ metadata.gz: a6283ea52aa5caa6f2e03a0bd147796d16edc52642f93fa9e33320911d0b56ecaf7b7211de871fe642536ea7cd0f1b9ee2ca026b989c302d86d4b147355643c8
7
+ data.tar.gz: fd08016205d931d6ab40bb74df0893bc862b2b216da306cd9546b29fb8a35bd85a782c5654846531dccf1474c34aafb9f667f3632044b09fa2c9a68ff6ae7dfb
@@ -46,10 +46,10 @@ module Uc3DmpApiCore
46
46
 
47
47
  # Fetch the current :page and :per_page from the params or use the defaults
48
48
  def _current_page(item_count: 0, params: {})
49
- page = params.fetch('page', DEFAULT_PAGE)
50
- page = DEFAULT_PAGE if page.nil? || page <= 1
51
- per_page = params.fetch('per_page', DEFAULT_PER_PAGE)
52
- per_page = DEFAULT_PER_PAGE if per_page.nil? || per_page >= MAXIMUM_PER_PAGE || per_page < 1
49
+ page = params.fetch('page', DEFAULT_PAGE).to_i
50
+ page = DEFAULT_PAGE if page.nil? || page.to_i <= 1
51
+ per_page = params.fetch('per_page', DEFAULT_PER_PAGE).to_i
52
+ per_page = DEFAULT_PER_PAGE if per_page.nil? || per_page.to_i >= MAXIMUM_PER_PAGE || per_page.to_i < 1
53
53
 
54
54
  total_pages = _page_count(total: item_count, per_page: per_page)
55
55
  page = total_pages if page > total_pages
@@ -82,11 +82,7 @@ module Uc3DmpApiCore
82
82
  def headers
83
83
  return {} if ENV['CORS_ORIGIN'].nil?
84
84
 
85
- {
86
- 'Access-Control-Allow-Headers': ENV.fetch('CORS_HEADERS', nil),
87
- 'Access-Control-Allow-Origin': ENV.fetch('CORS_ORIGIN', nil),
88
- 'Access-Control-Allow-Methods': ENV.fetch('CORS_METHODS', nil)
89
- }
85
+ { 'access-control-allow-origin': ENV['CORS_ORIGIN'] }
90
86
  end
91
87
  end
92
88
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpApiCore
4
- VERSION = '0.0.9'
4
+ VERSION = '0.0.10'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-api-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-02 00:00:00.000000000 Z
11
+ date: 2023-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json