Skip to content
Clone

feat(issues): add issue_reaction list_comment handler

zhenyi committed
parent 0bde0f8 commit f2436ef Browse files

1 file changed

+26 −0

Added lib/issues/handler/issue_reaction/list_comment.rs View lib/issues/handler/issue_reaction/list_comment.rs
@@ -0,0 +1,26 @@
1use axum::Json;
2use axum::extract::{Path, State};
3use jwt::extractor::AuthUser;
4use uuid::Uuid;
5
6use crate::error::IssueResult;
7use crate::features::IssueService;
8use crate::features::issue_reaction::ReactionAggView;
9
10#[utoipa::path(
11 get,
12 path = "/issues/{channel_id}/{issue_id}/comments/{comment_id}/reactions",
13 tag = "issues",
14 responses((status = 200, description = "List comment reactions")),
15 security(("bearer_auth" = []))
16)]
17pub(crate) async fn handler(
18 State(svc): State<IssueService>,
19 AuthUser { claims }: AuthUser,
20 Path((channel_id, issue_id, comment_id)): Path<(Uuid, Uuid, Uuid)>,
21) -> IssueResult<Json<Vec<ReactionAggView>>> {
22 let views = svc
23 .list_reactions_for_comment(claims.sub, channel_id, issue_id, comment_id)
24 .await?;
25 Ok(Json(views))
26}
No newline at end of file