dmp-dynamo_adapter 0.2.1 → 0.2.2
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: 482c56531b1bce877f93b66efbdc8aefc4b2c120b5d81eb3713035dfb546149d
|
4
|
+
data.tar.gz: bd9680232b0bbfcf92bdeec0b56ec62f335ccefb52acb9d902fc02e00e73659c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a2e6307f60b392621225539e2065633a64859b8dbc60bc83fa1cb559b6960d5f581eace2ada534bbce85d5bf009502642f9065e27fff683d57f967298fe415e
|
7
|
+
data.tar.gz: dfd6fdaaf576d91b96fcdb37a7ce6f060a66f8d7ae4511205f08106259eecb6104a65f024cbe4c3ebc07e9221e83c266b627caeef7bc0827fb6f85524d6b082e
|
data/lib/dmp/dynamo_adapter.rb
CHANGED
@@ -105,7 +105,7 @@ p "FINDING BY PK: PK - #{p_key.inspect} / SK - #{s_key.inspect}"
|
|
105
105
|
|
106
106
|
# Try to find it first
|
107
107
|
result = find_by_json(json: json)
|
108
|
-
return { status: 500, error: MSG_DEFAULT } if result[:status] == 500
|
108
|
+
return { status: 500, error: result.fetch(:error, MSG_DEFAULT) } if result[:status] == 500
|
109
109
|
# Abort if found
|
110
110
|
return { status: 400, error: MSG_EXISTS } if result[:items].any?
|
111
111
|
|
@@ -146,7 +146,7 @@ pp response.data
|
|
146
146
|
|
147
147
|
# Try to find it first
|
148
148
|
result = find_by_json(json: json)
|
149
|
-
return { status: 500, error: MSG_DEFAULT } if result[:status] == 500
|
149
|
+
return { status: 500, error: result.fetch(:error, MSG_DEFAULT) } if result[:status] == 500
|
150
150
|
|
151
151
|
dmp = result[:items].first&.item
|
152
152
|
return { status: 404, error: MSG_NOT_FOUND } if dmp.nil?
|
@@ -204,7 +204,7 @@ pp json
|
|
204
204
|
|
205
205
|
# Try to find it first
|
206
206
|
result = find_by_json(json: json)
|
207
|
-
return { status: 500, error: MSG_DEFAULT } if result[:status] == 500
|
207
|
+
return { status: 500, error: result.fetch(:error, MSG_DEFAULT) } if result[:status] == 500
|
208
208
|
# Abort if NOT found
|
209
209
|
return { status: 404, error: MSG_NOT_FOUND } unless result[:status] == 200 && result.fetch(:items, []).any?
|
210
210
|
|