refactor(repo): refresh contents change_files handler
zhenyi committed
Modified lib/repo/handler/contents/change_files.rs lib/repo/handler/contents/change_files.rs +8 −7 View lib/repo/handler/contents/change_files.rs
@@ -1,5 +1,6 @@
1use axum::Json;
21use axum::extract::{Path, State};
2use export::data::{AppRequest, AppRequestData, AppResponseData};
3
34use jwt::extractor::AuthUser;
45use uuid::Uuid;
56
@@ -11,16 +12,16 @@
1112 post,
1213 path = "/repo/{channel_id}/{repo_id}/contents/change",
1314 tag = "repo",
14 request_body = ChangeFilesOptions,
15 responses((status = 200, description = "Multi-file change", body = ContentsListResponse)),
15 request_body = AppRequestData<ChangeFilesOptions>,
16 responses((status = 200, description = "Multi-file change", body = AppResponseData<ContentsListResponse>)),
1617 security(("bearer_auth" = []))
1718)]
1819pub(crate) async fn handler(
1920 State(svc): State<RepoService>,
2021 AuthUser { claims }: AuthUser,
2122 Path((_, repo_id)): Path<(Uuid, Uuid)>,
22 Json(input): Json<ChangeFilesOptions>,
23) -> RepoResult<Json<ContentsListResponse>> {
24 let resp = svc.change_files(claims.sub, repo_id, input).await?;
25 Ok(Json(resp))
23 input: AppRequest<ChangeFilesOptions>,
24) -> RepoResult<AppResponseData<ContentsListResponse>> {
25 let resp = svc.change_files(claims.sub, repo_id, input.into_inner()).await?;
26 Ok(AppResponseData::ok(resp))
2627}