fix: delete memberships when community is deleted from account deletion

This commit is contained in:
trisua 2025-05-09 22:59:19 -04:00
parent 3706764437
commit 9ce1161361
4 changed files with 28 additions and 13 deletions

View file

@ -208,14 +208,8 @@ impl DataManager {
self.cache_clear_user(&user).await;
// delete communities
let res = execute!(
&conn,
"DELETE FROM communities WHERE owner = $1",
&[&(id as i64)]
);
if let Err(e) = res {
return Err(Error::DatabaseError(e.to_string()));
for community in self.get_communities_by_owner(user.id).await? {
self.delete_community(community.id, &user).await?;
}
// delete memberships