Skip to content
Clone

feat(issues): add issue_reaction delete handler

zhenyi committed
parent 997ed52 commit be1c592 Browse files

1 file changed

+23 −0

Added lib/issues/handler/issue_reaction/delete.rs View lib/issues/handler/issue_reaction/delete.rs
@@ -0,0 +1,23 @@
1use axum::extract::{Path, State};
2use axum::http::StatusCode;
3use jwt::extractor::AuthUser;
4use uuid::Uuid;
5
6use crate::error::IssueResult;
7use crate::features::IssueService;
8
9#[utoipa::path(
10 delete,
11 path = "/issues/{channel_id}/{issue_id}/reactions/{reaction_id}",
12 tag = "issues",
13 responses((status = 204, description = "Delete reaction")),
14 security(("bearer_auth" = []))
15)]
16pub(crate) async fn handler(
17 State(svc): State<IssueService>,
18 AuthUser { claims }: AuthUser,
19 Path((_channel_id, _issue_id, reaction_id)): Path<(Uuid, Uuid, Uuid)>,
20) -> IssueResult<StatusCode> {
21 svc.delete_reaction(claims.sub, reaction_id).await?;
22 Ok(StatusCode::NO_CONTENT)
23}
No newline at end of file