wolf_core 1.0.77 → 1.0.79
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: cc3e21eb1532a5bd8771602f7dd2232b90e4473c250b89a1622522611b296c9e
|
4
|
+
data.tar.gz: 36059878bace0fe3f461ccb766b1a7ef82fe005fb2ba8d920dcfc6f9f3f9cd41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95bbf884e9bdd6ecff49f31c0d13acfe7d83bff9b8f0b25197d3d59cadc3f47d6759dfbbb6a017093ff407136f4fd852286e565d52d2bc0553fdb38a96a5b4f7
|
7
|
+
data.tar.gz: e30ba7b7e3a113e0646bd686d73da9bf463b2316d571841a538b31c31779fc8d1f8f5334b7dbdf94d4acd1c29df9223c4052920bd1ccb7348aac03b38763e05c
|
@@ -130,6 +130,38 @@ module WolfCore
|
|
130
130
|
)
|
131
131
|
end
|
132
132
|
end
|
133
|
+
|
134
|
+
def upsert_custom_value(wolf_token:, tenant:, wolf_platform_url:, query:, custom_requirement_id:, custom_value:)
|
135
|
+
response = fetch_custom_values(
|
136
|
+
wolf_token: wolf_token,
|
137
|
+
tenant: tenant,
|
138
|
+
wolf_platform_url: wolf_platform_url,
|
139
|
+
query: query
|
140
|
+
)
|
141
|
+
|
142
|
+
return response unless response_success?(response)
|
143
|
+
|
144
|
+
custom_values = response.body.dig("data", "table", "custom_values")
|
145
|
+
|
146
|
+
if custom_values&.any?
|
147
|
+
custom_value_id = custom_values.first["id"]
|
148
|
+
update_custom_value(
|
149
|
+
wolf_platform_url: wolf_platform_url,
|
150
|
+
tenant: tenant,
|
151
|
+
wolf_token: wolf_token,
|
152
|
+
custom_value_id: custom_value_id,
|
153
|
+
custom_value: custom_value
|
154
|
+
)
|
155
|
+
else
|
156
|
+
create_custom_value(
|
157
|
+
wolf_platform_url: wolf_platform_url,
|
158
|
+
tenant: tenant,
|
159
|
+
wolf_token: wolf_token,
|
160
|
+
custom_requirement_id: custom_requirement_id,
|
161
|
+
custom_value: custom_value
|
162
|
+
)
|
163
|
+
end
|
164
|
+
end
|
133
165
|
end
|
134
166
|
end
|
135
167
|
end
|
data/lib/wolf_core/version.rb
CHANGED