Skip to content
Clone
a06673b
39 lines 932 B Rust
use uuid::Uuid;
use crate::error::IssueResult;
use crate::features::IssueService;
use super::{UpsertWatchOption, WatchView};
use super::usecase;
impl IssueService {
pub async fn get_my_watch(
&self,
actor: Uuid,
_channel_id: Uuid,
issue_id: Uuid,
) -> IssueResult<WatchView> {
usecase::load_my_watch(self, issue_id, actor)
.await
.map(WatchView::from)
}
pub async fn upsert_watch(
&self,
actor: Uuid,
channel_id: Uuid,
issue_id: Uuid,
input: UpsertWatchOption,
) -> IssueResult<WatchView> {
usecase::upsert_watch(self, actor, channel_id, issue_id, &input.mode).await
}
pub async fn delete_watch(
&self,
actor: Uuid,
channel_id: Uuid,
issue_id: Uuid,
) -> IssueResult<()> {
usecase::delete_watch(self, actor, channel_id, issue_id).await
}
}