mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-22 21:39:21 +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
|
// Delete all group membership
|
||||||
groups_helper::delete_all_user_groups(user_id)?;
|
groups_helper::delete_all_user_groups(user_id)?;
|
||||||
|
|
||||||
|
// Delete all user comments
|
||||||
|
comments_helper::delete_all_user(user_id)?;
|
||||||
|
|
||||||
// TODO : continue work here
|
// TODO : continue work here
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -97,5 +97,14 @@ pub fn delete_all(post_id: u64) -> ResultBoxError {
|
|||||||
delete(c)?;
|
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(())
|
Ok(())
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user