dmp-dynamo_adapter 0.2.4 → 0.2.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 +3 -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: d0b673c5ab8af1a4ada8c4f14be3c2543c7af6e16ad3fbe34a31552451fea8a3
|
4
|
+
data.tar.gz: 77484e5b3f58fd9088b635ab2e9fcd47b493aeb4fefc46618daec56a6dd993aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b81abb15e34a2e6ca1d5dc0405b98bdae243b6099cca1f2c83735ea3b540c293059cb5d652d77095b899e2ac04b374f319dcdd6842f32a4b5dd76681b8bff083
|
7
|
+
data.tar.gz: 29a757ae20c3888e0f9c5dd8fdd17b2b77b20c2af5c1b9c0a14e003bf55054d371c57a484730088d4d50decc5e95e9f090135070bc3a6d6d8f6df495bc4c5bf2
|
data/lib/dmp/dynamo_adapter.rb
CHANGED
@@ -283,11 +283,11 @@ p "FINDING BY PROVENANCE ID: #{json['dmp_id']['identifier']}"
|
|
283
283
|
p "RESPONSE:"
|
284
284
|
pp response.data
|
285
285
|
|
286
|
-
return { status: 404, error: MSG_NOT_FOUND } if response.nil? || response[:
|
286
|
+
return { status: 404, error: MSG_NOT_FOUND } if response.nil? || response[:count] <= 0
|
287
287
|
|
288
288
|
# If we got a hit, fetch the DMP and return it.
|
289
|
-
find_by_pk(p_key: response.fetch(:
|
290
|
-
s_key: response.fetch(:
|
289
|
+
find_by_pk(p_key: response.fetch(:last_evaluated_key, {})[:hash_key_element],
|
290
|
+
s_key: response.fetch(:last_evaluated_key, {})[:range_key_element])
|
291
291
|
rescue Aws::Errors::ServiceError => e
|
292
292
|
{ status: 500, error: "#{MSG_DEFAULT} - #{e.message}" }
|
293
293
|
end
|