wolf_core 1.0.78 → 1.0.80
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dba5a6af48f4e65eb2177ce9efbe3054962b0ae0a9486c6e6bebf56e807e504b
|
4
|
+
data.tar.gz: a1e4b6de1374970c33cd412815538304ba4c055a7c56ac397372c574a41b68e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b95aa6e078393c421bd80c5181f492937663a854e10193578a0cc7c01d77993fb4f0274fdd2b651c3dfecf6375e0eda52e699e1f9666884ab216d9402844ee3c
|
7
|
+
data.tar.gz: d13fd447223299bbf6e2ed7198175c937c37cd47204bd5bfb96169903856a29314e1dd21b7bcb963cc77b08e52d637d44f91d3951d876b17c7c23af803b37f35
|
@@ -107,7 +107,8 @@ module WolfCore
|
|
107
107
|
validate_http_response(response: response, message: error_message, error_data: error_data)
|
108
108
|
custom_values = response.body.dig("data", "table", "custom_values")
|
109
109
|
|
110
|
-
if custom_values&.any?
|
110
|
+
response = if custom_values&.any?
|
111
|
+
operation_type = :update
|
111
112
|
custom_value_id = custom_values.first["id"]
|
112
113
|
update_custom_value!(
|
113
114
|
wolf_platform_url: wolf_platform_url,
|
@@ -119,6 +120,7 @@ module WolfCore
|
|
119
120
|
error_data: error_data
|
120
121
|
)
|
121
122
|
else
|
123
|
+
operation_type = :create
|
122
124
|
create_custom_value!(
|
123
125
|
wolf_platform_url: wolf_platform_url,
|
124
126
|
tenant: tenant,
|
@@ -129,40 +131,43 @@ module WolfCore
|
|
129
131
|
error_data: error_data
|
130
132
|
)
|
131
133
|
end
|
134
|
+
|
135
|
+
{ operation_type: operation_type, response: response }
|
132
136
|
end
|
133
137
|
|
134
|
-
def upsert_custom_value(wolf_token:, tenant:, wolf_platform_url:, query:, custom_requirement_id:, custom_value
|
138
|
+
def upsert_custom_value(wolf_token:, tenant:, wolf_platform_url:, query:, custom_requirement_id:, custom_value:)
|
135
139
|
response = fetch_custom_values(
|
136
140
|
wolf_token: wolf_token,
|
137
141
|
tenant: tenant,
|
138
142
|
wolf_platform_url: wolf_platform_url,
|
139
143
|
query: query
|
140
144
|
)
|
141
|
-
|
145
|
+
|
142
146
|
return response unless response_success?(response)
|
143
|
-
|
147
|
+
|
144
148
|
custom_values = response.body.dig("data", "table", "custom_values")
|
145
|
-
|
146
|
-
if custom_values&.any?
|
149
|
+
|
150
|
+
response = if custom_values&.any?
|
151
|
+
operation_type = :update
|
147
152
|
custom_value_id = custom_values.first["id"]
|
148
|
-
|
153
|
+
update_custom_value(
|
149
154
|
wolf_platform_url: wolf_platform_url,
|
150
155
|
tenant: tenant,
|
151
156
|
wolf_token: wolf_token,
|
152
157
|
custom_value_id: custom_value_id,
|
153
|
-
custom_value: custom_value
|
154
|
-
query: query
|
158
|
+
custom_value: custom_value
|
155
159
|
)
|
156
160
|
else
|
157
|
-
|
161
|
+
operation_type = :create
|
162
|
+
create_custom_value(
|
158
163
|
wolf_platform_url: wolf_platform_url,
|
159
164
|
tenant: tenant,
|
160
165
|
wolf_token: wolf_token,
|
161
166
|
custom_requirement_id: custom_requirement_id,
|
162
|
-
custom_value: custom_value
|
163
|
-
query: query
|
167
|
+
custom_value: custom_value
|
164
168
|
)
|
165
169
|
end
|
170
|
+
OpenStruct.new({ operation_type: operation_type, response: response })
|
166
171
|
end
|
167
172
|
end
|
168
173
|
end
|
data/lib/wolf_core/version.rb
CHANGED