From 45037f86725899912da45abdd27ffa60b2b44f27 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 22 Feb 2021 22:31:09 -0500 Subject: [PATCH] Fix gitea repo release API url --- src/gitea.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gitea.rs b/src/gitea.rs index cec4784..fd17430 100644 --- a/src/gitea.rs +++ b/src/gitea.rs @@ -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, 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::>() { + let result = resp.json::>(); + 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())