diff --git a/src/data.rs b/src/data.rs index 061265e..39a32b2 100644 --- a/src/data.rs +++ b/src/data.rs @@ -33,15 +33,7 @@ async fn get_author_id(user: &str) -> Result> { .send() .await?; - - // Print the entire response body - let response_text = response.text().await?; - Err(Box::new(std::io::Error::new( - std::io::ErrorKind::Other, - format!("Server Response: {}", response_text) - ))) - - /* if response.status().is_success() { + if response.status().is_success() { let r: HashMap = response.json().await?; let author_id = r .get("data") @@ -67,7 +59,6 @@ async fn get_author_id(user: &str) -> Result> { format!("Request failed with status: {}", response.status()), ))) } - */ } @@ -90,7 +81,7 @@ pub async fn get_id_by_token(token: &str) -> Result> { "operationName": operation, "variables": variables }); - // println!("GraphQL Query: {}", gql); + println!("[get_id_by_token] GraphQL Query: {}", gql); let client = HTTPClient::new(); let response = client .post(&auth_api_base) @@ -98,7 +89,7 @@ pub async fn get_id_by_token(token: &str) -> Result> { .json(&gql) .send() .await?; - + if response.status().is_success() { let r: HashMap = response.json().await?; let user_id = r