patch_retention 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74769f12f495c1ff67df371af6f479ed920b3ea5482ee632121335b02cef81a4
4
- data.tar.gz: 692a99729ed3badf1bec6be626e869a8ce34653ff5800181532d18ac54454d36
3
+ metadata.gz: e09da85122b9149656266b2ffb272f51ec729747c97f52287dd5c89b2b26a03c
4
+ data.tar.gz: 7806f37ed28567871f577c26f8565107d21e65da1dbe58497a177b9920a2222e
5
5
  SHA512:
6
- metadata.gz: b56a950a4024d1ac2830f990aefe7a4c2c80b411b4fafb9c72b1681bfb11b31c6f329b833d60885ffdf7bd060f535de11d790e3b97deb22730647f6157af1445
7
- data.tar.gz: 95ba13ef24688739d163e426e5dae899211b22cd710bf121a2b3b8b81aeee632cabda9a58d0c72c9762eb87d8e4268a3f10c306e7eb6d9ea0404f68e18b36d38
6
+ metadata.gz: e17497a6c6cb6f2e24002a72438689e67d8d862c2b20eb43ffac61ce7427f7a46eef1096e11ef31dd153b1492880fbedfba8c95c24cb4fc29c9ffaa24bd16368
7
+ data.tar.gz: f674998100632b6e64fcbe01d4af1f828b1636e5fe59e5f797d7287c42d7e013494ac59091eb02415a007fa3818e8698a3bd3cf62cb2ee87475237ce29b98247
data/CHANGELOG.md CHANGED
@@ -12,6 +12,10 @@
12
12
 
13
13
  - Enhanced the `PatchRetention::Contacts::FindOrCreate` service to accept a flexible set of contact parameters, removing the previous restriction on allowed keys.
14
14
 
15
+ ## [0.1.5] - YYYY-MM-DD
16
+
17
+ - Fixed `PatchRetention::Contacts::FindOrCreate` to correctly format search query parameters according to API expectations.
18
+
15
19
  ## [0.1.0] - 2023-12-03
16
20
 
17
21
  - Initial release
@@ -7,7 +7,10 @@ module PatchRetention::Contacts::FindOrCreate
7
7
  def call(contact_params:, query_params:, config: nil)
8
8
  raise_error_if_present do
9
9
  PatchRetention.connection(config).patch(PatchRetention::Contacts::API_PATH) do |req|
10
- req.params["search"] = build_search_string(query_params)
10
+ build_search_params(query_params).each do |key, value|
11
+ req.params[key] = value
12
+ end
13
+
11
14
  req.body = contact_params
12
15
  end
13
16
  end
@@ -15,11 +18,10 @@ module PatchRetention::Contacts::FindOrCreate
15
18
 
16
19
  private
17
20
 
18
- def build_search_string(query_params)
19
- query_params = query_params.slice(:email, :phone).compact.map do |key, value|
20
- { "search:#{key}" => value }
21
- end.reduce(&:merge)
22
-
23
- URI.encode_www_form(query_params)
21
+ # Returns a hash of search parameters, correctly prefixed
22
+ def build_search_params(query_params)
23
+ query_params.slice(:email, :phone).compact.transform_keys do |key|
24
+ "search:#{key}"
25
+ end
24
26
  end
25
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PatchRetention
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patch_retention
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Playbypoint