Skip to content
Clone

refactor(issues): refresh issue_stopwatch start handler

zhenyi committed
parent ffaa401 commit ff22adc Browse files

1 file changed

+4 −5

Modified lib/issues/handler/issue_stopwatch/start.rs View lib/issues/handler/issue_stopwatch/start.rs
@@ -1,6 +1,5 @@
1use axum::Json;
21use axum::extract::{Path, State};
3use axum::http::StatusCode;
2use export::data::AppResponseData;
43use jwt::extractor::AuthUser;
54use uuid::Uuid;
65
@@ -12,16 +11,16 @@
1211 post,
1312 path = "/issues/{channel_id}/{issue_id}/stopwatch",
1413 tag = "issues",
15 responses((status = 201, description = "Start stopwatch", body = StopwatchView)),
14 responses((status = 201, description = "Start stopwatch", body = AppResponseData<StopwatchView>)),
1615 security(("bearer_auth" = []))
1716)]
1817pub(crate) async fn handler(
1918 State(svc): State<IssueService>,
2019 AuthUser { claims }: AuthUser,
2120 Path((channel_id, issue_id)): Path<(Uuid, Uuid)>,
22) -> IssueResult<(StatusCode, Json<StopwatchView>)> {
21) -> IssueResult<AppResponseData<StopwatchView>> {
2322 let view = svc
2423 .start_watch(claims.sub, channel_id, issue_id)
2524 .await?;
26 Ok((StatusCode::CREATED, Json(view)))
25 Ok(AppResponseData::ok(view).with_code(201))
2726}
No newline at end of file