12 lines
251 B
Rust
12 lines
251 B
Rust
|
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
|
||
|
}
|