wip
This commit is contained in:
21
src/services/cv.rs
Normal file
21
src/services/cv.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use ovlach_data::cv::cv::CV;
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum FetchError {
|
||||
ReqwestError(reqwest::Error)
|
||||
}
|
||||
|
||||
impl From<reqwest::Error> for FetchError {
|
||||
fn from(e: reqwest::Error) -> Self {
|
||||
FetchError::ReqwestError(e)
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn fetch_cv_data_from_backend(backend_host: String) -> Result<CV, FetchError> {
|
||||
let resp = reqwest::get(format!("{}/{}", backend_host, "/api/cv/ovlach"))
|
||||
.await?
|
||||
.json::<CV>()
|
||||
.await?;
|
||||
Ok(resp)
|
||||
}
|
||||
1
src/services/mod.rs
Normal file
1
src/services/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod cv;
|
||||
Reference in New Issue
Block a user