pickcat_api_collection/
notification.rs1use crate::dto::notification::NotificationSummaryDTO;
6use crate::{Error, PickcatAccound};
7
8pub trait NotificationBehavior {
13 fn get_notification_summary(
15 &self,
16 ) -> impl std::future::Future<Output = Result<NotificationSummaryDTO, Error>> + Send;
17}
18
19impl NotificationBehavior for PickcatAccound {
20 async fn get_notification_summary(&self) -> Result<NotificationSummaryDTO, Error> {
21 Ok(self
22 .client
23 .get(format!("{}/api/v1/notification-summary", self.base_url))
24 .send()
25 .await?
26 .json::<NotificationSummaryDTO>()
27 .await?)
28 }
29}