trytofix
This commit is contained in:
10
src/data.rs
10
src/data.rs
@@ -34,8 +34,7 @@ pub async fn get_auth_id(token: &str) -> Result<i32, Box<dyn Error>> {
|
||||
|
||||
async fn get_shout_followers(shout_id: &str) -> Result<Vec<i32>, Box<dyn Error>> {
|
||||
let api_base = env::var("API_BASE")?;
|
||||
let gql = format!(r#"
|
||||
query {{
|
||||
let gql = format!(r#"query ShoutFollowers {{
|
||||
shoutFollowers(shout: {}) {{
|
||||
follower {{
|
||||
id
|
||||
@@ -43,10 +42,15 @@ async fn get_shout_followers(shout_id: &str) -> Result<Vec<i32>, Box<dyn Error>>
|
||||
}}
|
||||
}}
|
||||
"#, shout_id);
|
||||
let body = format!(r#"{{
|
||||
"query": "{}",
|
||||
"operationName": "ShoutFollowers",
|
||||
"variables": {{}}
|
||||
}}"#, gql);
|
||||
let client = reqwest::Client::new();
|
||||
let response = client
|
||||
.post(&api_base)
|
||||
.body(gql)
|
||||
.body(body)
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
|
Reference in New Issue
Block a user