bazzar/web/src/api/public.rs

12 lines
251 B
Rust
Raw Normal View History

2022-05-09 16:17:27 +02:00
use seed::prelude::*;
pub async fn fetch_products() -> fetch::Result<model::api::Products> {
Request::new("/api/v1/products")
.method(Method::Get)
.fetch()
.await?
.check_status()?
.json()
.await
}