diff --git a/src/api/comment.rs b/src/api/comment.rs deleted file mode 100644 index e69de29..0000000 diff --git a/src/api/fetch_github_data.rs b/src/api/fetch_github_data.rs index 2466b22..42b9559 100644 --- a/src/api/fetch_github_data.rs +++ b/src/api/fetch_github_data.rs @@ -42,6 +42,9 @@ pub async fn get_github_response(username: &str, access_token: &str, status: &st if item.state == "open" { let comments_url = &item.comments_url; let comments_response = client.get(comments_url).send().await?; + if !comments_response.status().is_success() { + println!("Error: {}", comments_response.status()); + } let comments_json: Vec = comments_response.json().await?; item.comments_list = comments_json; } diff --git a/src/render_items/render_issues.rs b/src/render_items/render_issues.rs index 1de0480..cd5d467 100644 --- a/src/render_items/render_issues.rs +++ b/src/render_items/render_issues.rs @@ -78,14 +78,14 @@ pub fn render_issues<'a>(issues: &Vec, selected_issue_index: Op if show_comment == true { let comments_text: Vec = selected_issue - .comments_list - .iter() - .filter(|comment| comment.user.login != "netlify[bot]" && comment.user.login != "gatsby-cloud[bot]" ) - .map(|comment| { - let formatted_body = wrap(&comment.body, body_width).join("\n"); - format!("{}: {}", comment.user.login, formatted_body) - }) - .collect(); + .comments_list + .iter() + .filter(|comment| comment.user.login != "netlify[bot]" && comment.user.login != "gatsby-cloud[bot]" ) + .map(|comment| { + let formatted_body = wrap(&comment.body, body_width).join("\n"); + format!("{}: {}", comment.user.login, formatted_body) + }) + .collect(); let comments_cell; if comments_text.len() == 0 { comments_cell = Cell::from("No comments");