wip
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
use ovlach_data::cv::cv::CV;
|
||||
use ovlach_data::cv::data::CV;
|
||||
use reqwest::Client;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -12,10 +14,14 @@ impl From<reqwest::Error> for FetchError {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn fetch_cv_data_from_backend(backend_host: String) -> Result<CV, FetchError> {
|
||||
let resp = reqwest::get(format!("{}/{}", backend_host, "/api/cv/ovlach"))
|
||||
#[instrument]
|
||||
pub async fn fetch_cv_data_from_backend(backend_host: &String, person_name: &String, client: &Client) -> Result<CV, FetchError> {
|
||||
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::<CV>()
|
||||
.await?;
|
||||
Ok(resp)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user