conduit_cli/modrinth/projects.rs
1use super::client::ModrinthAPI;
2use crate::modrinth::models::Project;
3
4impl ModrinthAPI {
5 pub async fn get_project(&self, id_or_slug: &str) -> Result<Project, reqwest::Error> {
6 let url = format!("{}/project/{}", self.base_url, id_or_slug);
7 self.client
8 .get(url)
9 .send()
10 .await?
11 .error_for_status()?
12 .json::<Project>()
13 .await
14 }
15}