diff --git a/lib/monitor_client/src/lib.rs b/lib/monitor_client/src/lib.rs index 153dee96d..86c83f3ba 100644 --- a/lib/monitor_client/src/lib.rs +++ b/lib/monitor_client/src/lib.rs @@ -1,6 +1,7 @@ // #![allow(unused)] use anyhow::{anyhow, Context}; +use monitor_types::User; use reqwest::StatusCode; use serde::{de::DeserializeOwned, Serialize}; use serde_json::json; @@ -91,8 +92,13 @@ impl MonitorClient { .await } - pub async fn get_user(&self) -> anyhow::Result { - self.get_string("/api/user", Option::::None).await + pub async fn get_user(&self) -> anyhow::Result { + self.get("/api/user", Option::<()>::None).await + } + + pub async fn get_username(&self, user_id: &str) -> anyhow::Result { + self.get_string(&format!("/api/username/{user_id}"), Option::<()>::None) + .await } async fn get(