refactor(repo): refresh deploy_key get handler
zhenyi committed
Modified lib/repo/handler/deploy_key/get.rs lib/repo/handler/deploy_key/get.rs +5 −4 View lib/repo/handler/deploy_key/get.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}/keys/{key_id}",
1314 tag = "repo",
14 responses((status = 200, description = "Get a deploy key", body = DeployKeyView)),
15 responses((status = 200, description = "Get a deploy key", body = AppResponseData<DeployKeyView>)),
1516 security(("bearer_auth" = []))
1617)]
1718pub(crate) async fn handler(
1819 State(svc): State<RepoService>,
1920 AuthUser { claims }: AuthUser,
2021 Path((_, repo_id, key_id)): Path<(Uuid, Uuid, Uuid)>,
21) -> RepoResult<Json<DeployKeyView>> {
22) -> RepoResult<AppResponseData<DeployKeyView>> {
2223 let view = svc.get_deploy_key(claims.sub, repo_id, key_id).await?;
23 Ok(Json(view))
24 Ok(AppResponseData::ok(view))
2425}