wolf_core 1.0.79 → 1.0.80
Sign up to get free protection for your applications and to get access to all the features.
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,6 +131,8 @@ 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
138
|
def upsert_custom_value(wolf_token:, tenant:, wolf_platform_url:, query:, custom_requirement_id:, custom_value:)
|
@@ -143,7 +147,8 @@ module WolfCore
|
|
143
147
|
|
144
148
|
custom_values = response.body.dig("data", "table", "custom_values")
|
145
149
|
|
146
|
-
if custom_values&.any?
|
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,
|
@@ -153,6 +158,7 @@ module WolfCore
|
|
153
158
|
custom_value: custom_value
|
154
159
|
)
|
155
160
|
else
|
161
|
+
operation_type = :create
|
156
162
|
create_custom_value(
|
157
163
|
wolf_platform_url: wolf_platform_url,
|
158
164
|
tenant: tenant,
|
@@ -161,6 +167,7 @@ module WolfCore
|
|
161
167
|
custom_value: custom_value
|
162
168
|
)
|
163
169
|
end
|
170
|
+
OpenStruct.new({ operation_type: operation_type, response: response })
|
164
171
|
end
|
165
172
|
end
|
166
173
|
end
|
data/lib/wolf_core/version.rb
CHANGED