diff options
| author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2024-08-02 02:41:57 +0200 |
|---|---|---|
| committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2024-08-02 02:41:57 +0200 |
| commit | e552eb3e2cefb0b0ce4ca6affb850144cf0e33f5 (patch) | |
| tree | 8a271954526d5941c7ec3c509659eba1c700c9aa /src-tauri/src/github | |
| parent | 9ee553ef23cb86b2fcdf7879149c833c81fa8fb5 (diff) | |
| parent | edbce33c4a8f142967df868fb99476400f4ddfb3 (diff) | |
| download | FlightCore-e552eb3e2cefb0b0ce4ca6affb850144cf0e33f5.tar.gz FlightCore-e552eb3e2cefb0b0ce4ca6affb850144cf0e33f5.zip | |
Merge branch 'main' into feat/change-repair-window-to-tab
Diffstat (limited to 'src-tauri/src/github')
| -rw-r--r-- | src-tauri/src/github/pull_requests.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src-tauri/src/github/pull_requests.rs b/src-tauri/src/github/pull_requests.rs index 7e400c1a..de733feb 100644 --- a/src-tauri/src/github/pull_requests.rs +++ b/src-tauri/src/github/pull_requests.rs @@ -32,6 +32,7 @@ pub struct PullsApiResponseElement { url: String, head: CommitHead, html_url: String, + labels: Vec<String>, } // GitHub API response JSON elements as structs @@ -102,6 +103,14 @@ pub async fn get_pull_requests( repo, }; + // Get labels and their names and put the into vector + let label_names: Vec<String> = item + .labels + .unwrap_or_else(Vec::new) + .into_iter() + .map(|label| label.name) + .collect(); + // TODO there's probably a way to automatically serialize into the struct but I don't know yet how to let elem = PullsApiResponseElement { number: item.number, @@ -112,6 +121,7 @@ pub async fn get_pull_requests( .html_url .ok_or(anyhow!("html_url not found"))? .to_string(), + labels: label_names, }; all_pull_requests.push(elem); |
