Skip to content
Clone

refactor(repo): refresh extras license handler

zhenyi committed
parent 2f2e273 commit 748131d Browse files

1 file changed

+5 −4

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