fix: delete memberships when community is deleted from account deletion
This commit is contained in:
parent
3706764437
commit
9ce1161361
4 changed files with 28 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue