Skip to content
Clone

refactor(space): refresh channels get handler

zhenyi committed
parent 233d158 commit d105a32 Browse files

1 file changed

+4 −4

Modified lib/space/handler/channels/get.rs View lib/space/handler/channels/get.rs
@@ -1,8 +1,8 @@
1use axum::Json;
21use axum::extract::{Path, State};
32use jwt::extractor::AuthUser;
43use uuid::Uuid;
54
5use export::data::AppResponseData;
66use crate::error::SpaceResult;
77use crate::features::SpaceService;
88use crate::features::channels::ChannelView;
@@ -11,14 +11,14 @@
1111 get,
1212 path = "/spaces/{sid}/channels/{cid}",
1313 tag = "space",
14 responses((status = 200, description = "Get a channel", body = ChannelView)),
14 responses((status = 200, description = "Get a channel", body = AppResponseData<ChannelView>)),
1515 security(("bearer_auth" = []))
1616)]
1717pub(crate) async fn handler(
1818 State(svc): State<SpaceService>,
1919 AuthUser { claims }: AuthUser,
2020 Path((sid, cid)): Path<(Uuid, Uuid)>,
21) -> SpaceResult<Json<ChannelView>> {
21) -> SpaceResult<AppResponseData<ChannelView>> {
2222 let view = svc.get_channel(claims.sub, sid, cid).await?;
23 Ok(Json(view))
23 Ok(AppResponseData::ok(view))
2424}
No newline at end of file