dmp-dynamo_adapter 0.3.2 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dmp/dynamo_adapter.rb +2 -3
- 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: e43418981a0779208d1a8a30b20c49bc1b7694170dd750d21f0a55397dd26270
|
4
|
+
data.tar.gz: 8a31a47ea2e473a3297050cb3f3f6499ce1f62f220c8b25014f775153b542fbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4165f8e97a095e1390a7e8338a5b8fbfb56e40735a43432a1ace264d7ae2f6e9d093d7ab02efec61ef7f30a7858178ca3eb956d7e727a58a847d7566bc45580
|
7
|
+
data.tar.gz: 18d6c30540bef144f768034c3c35e05f43d2a892f49bd0b1eafc6bcdc3b332efc6e3fcaa903d145197c6528009ca93deff9c2daab016ba920de8baed8d7d051d
|
data/lib/dmp/dynamo_adapter.rb
CHANGED
@@ -89,7 +89,7 @@ p "FINDING BY PK: PK - #{p_key.inspect} / SK - #{s_key.inspect}"
|
|
89
89
|
|
90
90
|
# find_by_PK
|
91
91
|
response = find_by_pk(p_key: pk, s_key: json['SK']) unless pk.nil?
|
92
|
-
return response unless response[:status]
|
92
|
+
return response unless response[:status] == 404
|
93
93
|
|
94
94
|
# find_by_dmphub_provenance_id -> if no PK and no dmp_id result
|
95
95
|
find_by_dmphub_provenance_identifier(json: json)
|
@@ -285,8 +285,7 @@ pp response.data
|
|
285
285
|
return { status: 404, error: MSG_NOT_FOUND } if response.nil? || response[:count] <= 0
|
286
286
|
|
287
287
|
# If we got a hit, fetch the DMP and return it.
|
288
|
-
find_by_pk(p_key: response.
|
289
|
-
s_key: response.fetch(:last_evaluated_key, {})[:range_key_element])
|
288
|
+
find_by_pk(p_key: response[:items].first['PK'], s_key: response[:items].first['SK'])
|
290
289
|
rescue Aws::Errors::ServiceError => e
|
291
290
|
{ status: 500, error: "#{MSG_DEFAULT} - #{e.message}" }
|
292
291
|
end
|