diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/gitlab/api.rs | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/gitlab/api.rs b/src/gitlab/api.rs index 3ddf4ec4..9233413c 100644 --- a/src/gitlab/api.rs +++ b/src/gitlab/api.rs @@ -40,23 +40,8 @@ impl Api { &self, project_id: u64, ) -> Result<Vec<Member>, Box<dyn std::error::Error>> { - let url = format!( - "{}/api/v4/projects/{}/members/all", - self.host.trim_end_matches('/'), - project_id - ); - - let members = self - .client - .get(&url) - .header("PRIVATE-TOKEN", &self.token) - .send() - .await? - .error_for_status()? - .json() - .await?; - - Ok(members) + self.get::<Vec<Member>>(format!("/api/v4/projects/{}/members/all", project_id)) + .await } pub async fn get_group(&self, group_id: u64) -> Result<Group, Box<dyn std::error::Error>> { |
