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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/patch_retention/contacts/find_or_create.rb +9 -7
- data/lib/patch_retention/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e09da85122b9149656266b2ffb272f51ec729747c97f52287dd5c89b2b26a03c
|
4
|
+
data.tar.gz: 7806f37ed28567871f577c26f8565107d21e65da1dbe58497a177b9920a2222e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|