mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-23 05:49:22 +00:00
Delete all posts of user
This commit is contained in:
parent
5a7e356265
commit
ffbb81bade
@ -309,6 +309,9 @@ pub fn delete(user_id: &UserID) -> ResultBoxError {
|
|||||||
// Delete all user comments
|
// Delete all user comments
|
||||||
comments_helper::delete_all_user(user_id)?;
|
comments_helper::delete_all_user(user_id)?;
|
||||||
|
|
||||||
|
// Delete all user posts
|
||||||
|
posts_helper::delete_all_user(user_id)?;
|
||||||
|
|
||||||
// TODO : continue work here
|
// TODO : continue work here
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -466,6 +466,15 @@ pub fn delete_all_group(group_id: &GroupID) -> ResultBoxError {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Delete all the posts of a given user
|
||||||
|
pub fn delete_all_user(user_id: &UserID) -> ResultBoxError {
|
||||||
|
for post in &export_all_posts_user(user_id)? {
|
||||||
|
delete(&post)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
/// Get all the posts that use of movie
|
/// Get all the posts that use of movie
|
||||||
pub fn get_posts_for_movie(m: &Movie) -> ResultBoxError<Vec<Post>> {
|
pub fn get_posts_for_movie(m: &Movie) -> ResultBoxError<Vec<Post>> {
|
||||||
database::QueryInfo::new(POSTS_TABLE)
|
database::QueryInfo::new(POSTS_TABLE)
|
||||||
|
Loading…
Reference in New Issue
Block a user