refactor(repo): refresh git_ref tree handler
zhenyi committed
Modified lib/repo/handler/git_ref/tree.rs lib/repo/handler/git_ref/tree.rs +5 −4 View lib/repo/handler/git_ref/tree.rs
@@ -1,5 +1,6 @@
1use axum::Json;
21use axum::extract::{Path, Query, State};
2use export::data::AppResponseData;
3
34use jwt::extractor::AuthUser;
45use uuid::Uuid;
56
@@ -17,7 +18,7 @@
1718 path = "/repo/{channel_id}/{repo_id}/git/trees/{sha}",
1819 tag = "repo",
1920 params(TreeQuery),
20 responses((status = 200, description = "Get a tree", body = TreeView)),
21 responses((status = 200, description = "Get a tree", body = AppResponseData<TreeView>)),
2122 security(("bearer_auth" = []))
2223)]
2324pub(crate) async fn handler(
@@ -25,9 +26,9 @@
2526 AuthUser { claims }: AuthUser,
2627 Path((_, repo_id, sha)): Path<(Uuid, Uuid, String)>,
2728 Query(q): Query<TreeQuery>,
28) -> RepoResult<Json<TreeView>> {
29) -> RepoResult<AppResponseData<TreeView>> {
2930 let view = svc
3031 .get_tree(claims.sub, repo_id, &sha, q.recursive.unwrap_or(false))
3132 .await?;
32 Ok(Json(view))
33 Ok(AppResponseData::ok(view))
3334}