Skip to content
Clone

refactor(repo): refresh tag_protection list handler

zhenyi committed
parent 9e3913a commit 5930fed Browse files

1 file changed

+5 −4

Modified lib/repo/handler/tag_protection/list.rs View lib/repo/handler/tag_protection/list.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
@@ -12,7 +13,7 @@
1213 path = "/repo/{channel_id}/{repo_id}/tag_protections",
1314 tag = "repo",
1415 params(ListTagProtectionQuery),
15 responses((status = 200, description = "List tag protections", body = TagProtectionPage)),
16 responses((status = 200, description = "List tag protections", body = AppResponseData<TagProtectionPage>)),
1617 security(("bearer_auth" = []))
1718)]
1819pub(crate) async fn handler(
@@ -20,7 +21,7 @@
2021 AuthUser { claims }: AuthUser,
2122 Path((_, repo_id)): Path<(Uuid, Uuid)>,
2223 Query(q): Query<ListTagProtectionQuery>,
23) -> RepoResult<Json<TagProtectionPage>> {
24) -> RepoResult<AppResponseData<TagProtectionPage>> {
2425 let page = svc.list_tag_protections(claims.sub, repo_id, q).await?;
25 Ok(Json(page))
26 Ok(AppResponseData::ok(page))
2627}