Przeglądaj źródła

Fix gitea repo release API url

master
NGnius (Graham) 3 lat temu
rodzic
commit
45037f8672
1 zmienionych plików z 4 dodań i 3 usunięć
  1. +4
    -3
      src/gitea.rs

+ 4
- 3
src/gitea.rs Wyświetl plik

@@ -6,13 +6,14 @@ pub const GITEA_API_URL: &str = "https://git.exmods.org/api/v1";
// API endpoints
pub fn get_releases(owner: &str, repo: &str) -> Result<Vec<Release>, String> {
let client = blocking::Client::new();
let url = format!("{}/{}/{}/releases", GITEA_API_URL, owner, repo);
let url = format!("{}/repos/{}/{}/releases", GITEA_API_URL, owner, repo);
let result = client.get(&url).send();
if let Ok(resp) = result {
if let Ok(data) = resp.json::<Vec<Release>>() {
let result = resp.json::<Vec<Release>>();
if let Ok(data) = result {
return Ok(data);
} else {
return Err("Invalid JSON payload".to_string());
return Err(format!("Invalid JSON payload {}", result.err().unwrap()));
}
}
Err("Invalid Result".to_string())


Ładowanie…
Anuluj
Zapisz