debug-get-author

This commit is contained in:
Untone 2023-12-13 22:46:43 +03:00
parent 6a3d37b6bb
commit 39c4cf2d2a

View File

@ -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()),
)))
}
*/
}