diff --git a/src/common/wolves.rs b/src/common/wolves.rs index 7e29f1c..5a1e1b7 100644 --- a/src/common/wolves.rs +++ b/src/common/wolves.rs @@ -277,25 +277,24 @@ pub mod committees { }; let config = config_lock.read().await; - // TODO: proper api key management - let api_key = ""; // request data from wolves - for committee in get_committees(&config, api_key).await { - let tmp = Committees::from(committee); - add_committee(&db, &tmp).await; + for committee_wolves in get_committees(&config).await { + let committee = Committees::from(committee_wolves); + add_committee(&db, &committee).await; } } - async fn get_committees(config: &Config, wolves_api: &str) -> Vec { + async fn get_committees(config: &Config) -> Vec { if config.wolves_url.is_empty() { return vec![]; } // TODO: Change teh stored env value to teh base domain + // TODO: this address may change let url = format!("{}/get_cns", &config.wolves_url); // get wolves data - if let Ok(mut res) = surf::post(&url).header("X-AM-Identity", wolves_api).await { + if let Ok(mut res) = surf::post(&url).header("X-AM-Identity", &config.wolves_api).await { if let Ok(WolvesResult { success, result,