debug-get-author
This commit is contained in:
11
src/data.rs
11
src/data.rs
@@ -33,7 +33,15 @@ async fn get_author_id(user: &str) -> Result<i32, Box<dyn Error>> {
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
if response.status().is_success() {
|
||||
|
||||
// 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() {
|
||||
let r: HashMap<String, serde_json::Value> = response.json().await?;
|
||||
let author_id = r
|
||||
.get("data")
|
||||
@@ -59,6 +67,7 @@ async fn get_author_id(user: &str) -> Result<i32, Box<dyn Error>> {
|
||||
format!("Request failed with status: {}", response.status()),
|
||||
)))
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user