Skip to content
Clone

refactor(repo): refresh git_ref annotated_tag handler

zhenyi committed
parent 189f2fe commit ac083b7 Browse files

1 file changed

+5 −4

Modified lib/repo/handler/git_ref/annotated_tag.rs View lib/repo/handler/git_ref/annotated_tag.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,14 +12,14 @@
1112 get,
1213 path = "/repo/{channel_id}/{repo_id}/git/tags/{sha}",
1314 tag = "repo",
14 responses((status = 200, description = "Get an annotated tag", body = CommitView)),
15 responses((status = 200, description = "Get an annotated tag", body = AppResponseData<CommitView>)),
1516 security(("bearer_auth" = []))
1617)]
1718pub(crate) async fn handler(
1819 State(svc): State<RepoService>,
1920 AuthUser { claims }: AuthUser,
2021 Path((_, repo_id, sha)): Path<(Uuid, Uuid, String)>,
21) -> RepoResult<Json<CommitView>> {
22) -> RepoResult<AppResponseData<CommitView>> {
2223 let view = svc.get_commit(claims.sub, repo_id, &sha).await?;
23 Ok(Json(view))
24 Ok(AppResponseData::ok(view))
2425}