mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-12-27 22:18:51 +00:00
Delete all comments of user
This commit is contained in:
parent
f325ec7ae7
commit
5a7e356265
@ -306,6 +306,9 @@ pub fn delete(user_id: &UserID) -> ResultBoxError {
|
||||
// Delete all group membership
|
||||
groups_helper::delete_all_user_groups(user_id)?;
|
||||
|
||||
// Delete all user comments
|
||||
comments_helper::delete_all_user(user_id)?;
|
||||
|
||||
// TODO : continue work here
|
||||
|
||||
Ok(())
|
||||
|
@ -97,5 +97,14 @@ pub fn delete_all(post_id: u64) -> ResultBoxError {
|
||||
delete(c)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Delete all the comments created by a user
|
||||
pub fn delete_all_user(user_id: &UserID) -> ResultBoxError {
|
||||
for comment in &export_all_user(user_id)? {
|
||||
delete(comment)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
Loading…
Reference in New Issue
Block a user