use ovlach_data::cv::data::CV; use reqwest::Client; use tracing::{debug, instrument}; #[derive(Debug)] pub enum FetchError { ReqwestError(reqwest::Error) } impl From for FetchError { fn from(e: reqwest::Error) -> Self { FetchError::ReqwestError(e) } } #[instrument] pub async fn fetch_cv_data_from_backend(backend_host: &String, person_name: &String, client: &Client) -> Result { let url = format!("{}/{}/{}", backend_host, "api/v1/cv", person_name); debug!("Fetching CV data from backend: {}", url); let resp = client .get(url).send() .await? .json::() .await?; Ok(resp) }