Add eActivities module

This commit is contained in:
Aadi Desai 2023-09-23 23:13:49 +01:00
parent e92ee416c8
commit d62fabb048
Signed by: supleed2
SSH key fingerprint: SHA256:CkbNRs0yVzXEiUp2zd0PSxsfRUMFF9bLlKXtE1xEbKM

22
src/ea.rs Normal file
View file

@ -0,0 +1,22 @@
#[derive(serde::Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct EaMember {
pub first_name: String,
pub surname: String,
pub login: String,
pub order_no: usize,
}
pub(crate) async fn get_members_list(
api_key: &str,
url: &str,
) -> Result<Vec<EaMember>, reqwest::Error> {
let members = reqwest::Client::new()
.get(url)
.header("X-API-Key", api_key)
.send()
.await?
.json::<Vec<EaMember>>()
.await?;
Ok(members)
}