+ let form = ModRemoveCommunityForm {
+ mod_person_id: actor.id,
+ community_id: community.id,
+ removed: Some(true),
+ reason,
+ expires: None,
+ };
+ ModRemoveCommunity::create(&mut context.pool(), &form).await?;
+ Community::update(
+ &mut context.pool(),
+ community.id,
+ &CommunityUpdateForm::builder().removed(Some(true)).build(),
+ )
+ .await?;
+ }
+ DeletableObjects::Post(post) => {
+ let form = ModRemovePostForm {
+ mod_person_id: actor.id,
+ post_id: post.id,
+ removed: Some(true),
+ reason,
+ };
+ ModRemovePost::create(&mut context.pool(), &form).await?;
+ Post::update(
+ &mut context.pool(),
+ post.id,
+ &PostUpdateForm::builder().removed(Some(true)).build(),
+ )
+ .await?;
+ }
+ DeletableObjects::Comment(comment) => {
+ let form = ModRemoveCommentForm {
+ mod_person_id: actor.id,
+ comment_id: comment.id,
+ removed: Some(true),
+ reason,
+ };
+ ModRemoveComment::create(&mut context.pool(), &form).await?;
+ Comment::update(
+ &mut context.pool(),
+ comment.id,
+ &CommentUpdateForm::builder().removed(Some(true)).build(),
+ )
+ .await?;
+ }
+ DeletableObjects::PrivateMessage(_) => unimplemented!(),
+ }
+ Ok(())