/ web / src / services / cloudevents.rs
cloudevents.rs
 1  use crate::api::CloudEvent;
 2  use reqwest::Error;
 3  
 4  pub struct CloudEventsService;
 5  
 6  impl CloudEventsService {
 7      pub async fn fetch(url: &str) -> Result<Vec<CloudEvent>, Error> {
 8          reqwest::get(format!("{url}/api/cloudevents"))
 9              .await?
10              .json()
11              .await
12      }
13  }