Skip to content
Clone

refactor(repo): refresh topic update handler

zhenyi committed
parent 491f273 commit e6a2e73 Browse files

1 file changed

+7 −7

Modified lib/repo/handler/topic/update.rs View lib/repo/handler/topic/update.rs
@@ -1,6 +1,6 @@
1use axum::Json;
21use axum::extract::{Path, State};
3use axum::http::StatusCode;
2use export::data::{AppRequest, AppRequestData, AppResponseData, NoData};
3
44use jwt::extractor::AuthUser;
55use uuid::Uuid;
66
@@ -12,7 +12,7 @@
1212 put,
1313 path = "/repo/{channel_id}/{repo_id}/topics",
1414 tag = "repo",
15 request_body = RepoTopicOptions,
15 request_body = AppRequestData<RepoTopicOptions>,
1616 responses((status = 204, description = "Replace repo topics")),
1717 security(("bearer_auth" = []))
1818)]
@@ -20,8 +20,8 @@
2020 State(svc): State<RepoService>,
2121 AuthUser { claims }: AuthUser,
2222 Path((_, repo_id)): Path<(Uuid, Uuid)>,
23 Json(input): Json<RepoTopicOptions>,
24) -> RepoResult<StatusCode> {
25 svc.update_repo_topics(claims.sub, repo_id, input).await?;
26 Ok(StatusCode::NO_CONTENT)
23 input: AppRequest<RepoTopicOptions>,
24) -> RepoResult<AppResponseData<NoData>> {
25 svc.update_repo_topics(claims.sub, repo_id, input.into_inner()).await?;
26 Ok(AppResponseData::<NoData>::empty())
2727}