diff --git a/crates/api/src/community.rs b/crates/api/src/community.rs index dfa611746..69a6530cc 100644 --- a/crates/api/src/community.rs +++ b/crates/api/src/community.rs @@ -111,13 +111,13 @@ impl Perform for FollowCommunity { #[async_trait::async_trait(?Send)] impl Perform for BlockCommunity { - type Response = CommunityResponse; + type Response = BlockCommunityResponse; async fn perform( &self, context: &Data, _websocket_id: Option, - ) -> Result { + ) -> Result { let data: &BlockCommunity = self; let local_user_view = get_local_user_view_from_jwt(&data.auth, context.pool()).await?; @@ -147,7 +147,10 @@ impl Perform for BlockCommunity { }) .await??; - Ok(CommunityResponse { community_view }) + Ok(BlockCommunityResponse { + blocked: data.block, + community_view, + }) } } diff --git a/crates/api_common/src/community.rs b/crates/api_common/src/community.rs index 2a62a3c4e..68ba2ff68 100644 --- a/crates/api_common/src/community.rs +++ b/crates/api_common/src/community.rs @@ -122,6 +122,12 @@ pub struct BlockCommunity { pub auth: String, } +#[derive(Serialize, Clone)] +pub struct BlockCommunityResponse { + pub community_view: CommunityView, + pub blocked: bool, +} + #[derive(Deserialize)] pub struct TransferCommunity { pub community_id: CommunityId,