Skip to content
Clone

refactor(repo): refresh commit_status combined handler

zhenyi committed
parent e5a3507 commit 6c1e0ac Browse files

1 file changed

+5 −4

Modified lib/repo/handler/commit_status/combined.rs View lib/repo/handler/commit_status/combined.rs
@@ -1,5 +1,6 @@
1use axum::Json;
21use axum::extract::{Path, State};
2use export::data::AppResponseData;
3
34use jwt::extractor::AuthUser;
45use uuid::Uuid;
56
@@ -11,16 +12,16 @@
1112 get,
1213 path = "/repo/{channel_id}/{repo_id}/commits/{ref}/status",
1314 tag = "repo",
14 responses((status = 200, description = "Get combined status by ref", body = CombinedStatusView)),
15 responses((status = 200, description = "Get combined status by ref", body = AppResponseData<CombinedStatusView>)),
1516 security(("bearer_auth" = []))
1617)]
1718pub(crate) async fn handler(
1819 State(svc): State<RepoService>,
1920 AuthUser { claims }: AuthUser,
2021 Path((_, repo_id, git_ref)): Path<(Uuid, Uuid, String)>,
21) -> RepoResult<Json<CombinedStatusView>> {
22) -> RepoResult<AppResponseData<CombinedStatusView>> {
2223 let view = svc
2324 .combined_status_by_ref(claims.sub, repo_id, &git_ref)
2425 .await?;
25 Ok(Json(view))
26 Ok(AppResponseData::ok(view))
2627}