use reqwest::{header::ACCEPT, Error}; use serde::Deserialize; use crate::utils::get_reqwest_client; #[derive(Deserialize)] pub struct GithubResponse { pub total_count: u32, pub items: Vec, } #[derive(Deserialize)] pub struct GithubProject { pub repository_url: String, pub number: u32, pub title: String, pub state: String, pub pull_request: GithubPullRequest, } #[derive(Deserialize)] pub struct GithubPullRequest { pub html_url: String, pub merged_at: Option, } pub async fn fetch_pr() -> Result { let client = get_reqwest_client(); client .get("https://api.github.com/search/issues?q=is:pr%20author:Mylloon") .header(ACCEPT, "application/vnd.github.text-match+json") .send() .await? .json::() .await }