mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-27 05:11:32 +00:00
Adding BlockCommunityResponse
This commit is contained in:
parent
32062ecfab
commit
84288d7ad4
2 changed files with 12 additions and 3 deletions
|
@ -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<LemmyContext>,
|
||||
_websocket_id: Option<ConnectionId>,
|
||||
) -> Result<CommunityResponse, LemmyError> {
|
||||
) -> Result<BlockCommunityResponse, LemmyError> {
|
||||
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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue