started gitea api impl #2

Merged
qpismont merged 9 commits from gitea_api into main 2026-06-07 10:23:31 +02:00
Showing only changes of commit 6aa653e846 - Show all commits
+13 -4
View File
@@ -47,6 +47,10 @@ impl GiteaAPI {
.send() .send()
.await?; .await?;
if !res.status().is_success() {
return Err(anyhow::anyhow!("Failed to comment: {}", res.status()));
}
res.json::<Comment>().await.map_err(anyhow::Error::from) res.json::<Comment>().await.map_err(anyhow::Error::from)
} }
@@ -61,15 +65,20 @@ impl GiteaAPI {
self.base_url, full_name, comment_id self.base_url, full_name, comment_id
); );
self.client let res = self
.client
.patch(url) .patch(url)
.json(&json!({ .json(&json!({
"body": body "body": body
})) }))
.send() .send()
.await .await?;
.map(|_| ())
.map_err(anyhow::Error::from) if !res.status().is_success() {
return Err(anyhow::anyhow!("Failed to comment: {}", res.status()));
}
Ok(())
} }
} }