+ pub async fn leave_all_communities(
+ pool: &mut DbPool<'_>,
+ for_person_id: PersonId,
+ ) -> Result<usize, Error> {
+ use crate::schema::community_moderator::dsl::{community_moderator, person_id};
+ let conn = &mut get_conn(pool).await?;
+ diesel::delete(community_moderator.filter(person_id.eq(for_person_id)))
+ .execute(conn)
+ .await
+ }
+