0abe494
use axum::Json;
use axum::extract::{Path, State};
use jwt::extractor::AuthUser;
use uuid::Uuid;
use crate::error::IssueResult;
use crate::features::IssueService;
use crate::features::comment::CommentView;
#[utoipa::path(
get,
path = "/issues/{channel_id}/{issue_id}/comments/{comment_id}",
tag = "issues",
responses((status = 200, description = "Get comment", body = CommentView)),
security(("bearer_auth" = []))
)]
pub(crate) async fn handler(
State(svc): State<IssueService>,
AuthUser { claims }: AuthUser,
Path((channel_id, issue_id, comment_id)): Path<(Uuid, Uuid, Uuid)>,
) -> IssueResult<Json<CommentView>> {
let view = svc
.get_comment(claims.sub, channel_id, issue_id, comment_id)
.await?;
Ok(Json(view))
}