mirror of
https://github.com/dathere/ckanaction.git
synced 2025-11-09 14:19:49 +00:00
chore: use options as param instead of custom_fields for config_option_update
This commit is contained in:
parent
ccaefd8076
commit
b826768049
1 changed files with 4 additions and 4 deletions
|
|
@ -2359,14 +2359,14 @@ impl CKAN {
|
||||||
#[builder]
|
#[builder]
|
||||||
pub async fn config_option_update(
|
pub async fn config_option_update(
|
||||||
&self,
|
&self,
|
||||||
custom_fields: Option<serde_json::Value>,
|
options: Option<serde_json::Value>,
|
||||||
) -> Result<serde_json::Value, Box<dyn std::error::Error>> {
|
) -> Result<serde_json::Value, Box<dyn std::error::Error>> {
|
||||||
let endpoint = self.url.clone() + "/api/3/action/config_option_update";
|
let endpoint = self.url.clone() + "/api/3/action/config_option_update";
|
||||||
let mut map: HashMap<&str, serde_json::Value> = HashMap::new();
|
let mut map: HashMap<&str, serde_json::Value> = HashMap::new();
|
||||||
let mut custom_map: HashMap<String, serde_json::Value> = HashMap::new();
|
let mut custom_map: HashMap<String, serde_json::Value> = HashMap::new();
|
||||||
if let Some(custom) = custom_fields {
|
if let Some(options_obj) = options {
|
||||||
if custom.is_object() {
|
if options_obj.is_object() {
|
||||||
let custom_temp_map = custom.as_object().unwrap();
|
let custom_temp_map = options_obj.as_object().unwrap();
|
||||||
custom_map.extend(
|
custom_map.extend(
|
||||||
custom_temp_map
|
custom_temp_map
|
||||||
.iter()
|
.iter()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue