Skip to content
Clone

refactor(issues): refresh comment update handler

zhenyi committed
parent 36f20ce commit 0ecef20 Browse files

1 file changed

+7 −7

Modified lib/issues/handler/comment/update.rs View lib/issues/handler/comment/update.rs
@@ -1,5 +1,5 @@
1use axum::Json;
21use axum::extract::{Path, State};
2use export::data::{AppRequest, AppRequestData, AppResponseData};
33use jwt::extractor::AuthUser;
44use uuid::Uuid;
55
@@ -11,18 +11,18 @@
1111 patch,
1212 path = "/issues/{channel_id}/{issue_id}/comments/{comment_id}",
1313 tag = "issues",
14 request_body = UpdateCommentOption,
15 responses((status = 200, description = "Update comment", body = CommentView)),
14 request_body = AppRequestData<UpdateCommentOption>,
15 responses((status = 200, description = "Update comment", body = AppResponseData<CommentView>)),
1616 security(("bearer_auth" = []))
1717)]
1818pub(crate) async fn handler(
1919 State(svc): State<IssueService>,
2020 AuthUser { claims }: AuthUser,
2121 Path((channel_id, issue_id, comment_id)): Path<(Uuid, Uuid, Uuid)>,
22 Json(input): Json<UpdateCommentOption>,
23) -> IssueResult<Json<CommentView>> {
22 input: AppRequest<UpdateCommentOption>,
23) -> IssueResult<AppResponseData<CommentView>> {
2424 let view = svc
25 .update_comment(claims.sub, channel_id, issue_id, comment_id, input)
25 .update_comment(claims.sub, channel_id, issue_id, comment_id, input.into_inner())
2626 .await?;
27 Ok(Json(view))
27 Ok(AppResponseData::ok(view))
2828}
No newline at end of file