refactor(repo): refresh extras stargazer handler
zhenyi committed
Modified lib/repo/handler/extras/stargazer.rs lib/repo/handler/extras/stargazer.rs +5 −4 View lib/repo/handler/extras/stargazer.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
@@ -18,7 +19,7 @@
1819 path = "/repo/{channel_id}/{repo_id}/stargazers",
1920 tag = "repo",
2021 params(StargazerQuery),
21 responses((status = 200, description = "List stargazers", body = Vec<UserMini>)),
22 responses((status = 200, description = "List stargazers", body = AppResponseData<Vec<UserMini>>)),
2223 security(("bearer_auth" = []))
2324)]
2425pub(crate) async fn handler(
@@ -26,9 +27,9 @@
2627 AuthUser { claims }: AuthUser,
2728 Path((_, repo_id)): Path<(Uuid, Uuid)>,
2829 Query(q): Query<StargazerQuery>,
29) -> RepoResult<Json<Vec<UserMini>>> {
30) -> RepoResult<AppResponseData<Vec<UserMini>>> {
3031 let out = svc
3132 .list_stargazers(claims.sub, repo_id, q.page, q.limit)
3233 .await?;
33 Ok(Json(out))
34 Ok(AppResponseData::ok(out))
3435}