Skip to content
Clone

refactor(repo): refresh extras repo_by_id handler

zhenyi committed
parent f7bfb60 commit 3ca0832 Browse files

1 file changed

+5 −4

Modified lib/repo/handler/extras/repo_by_id.rs View lib/repo/handler/extras/repo_by_id.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 = "/repositories/{id}",
1314 tag = "repo",
14 responses((status = 200, description = "Get a repository by id", body = RepoSummary)),
15 responses((status = 200, description = "Get a repository by id", body = AppResponseData<RepoSummary>)),
1516 security(("bearer_auth" = []))
1617)]
1718pub(crate) async fn handler(
1819 State(svc): State<RepoService>,
1920 AuthUser { claims }: AuthUser,
2021 Path(id): Path<Uuid>,
21) -> RepoResult<Json<RepoSummary>> {
22) -> RepoResult<AppResponseData<RepoSummary>> {
2223 let out = svc.get_repo_by_id(claims.sub, id).await?;
23 Ok(Json(out))
24 Ok(AppResponseData::ok(out))
2425}