mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 16:35:17 +00:00
Delete all notifications about a post when making it private
This commit is contained in:
@ -246,9 +246,12 @@ pub fn set_visibility_level(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
let post = r.post_post_with_access("postID", PostAccessLevel::FULL_ACCESS)?;
|
||||
let new_visibility = PostVisibilityLevel::from_api(&r.post_string("new_level")?);
|
||||
|
||||
posts_helper::set_level(post.id, new_visibility)?;
|
||||
posts_helper::set_level(post.id, &new_visibility)?;
|
||||
|
||||
// TODO : Depending on new level, delete (or not) notifications about the post
|
||||
// Depending on new level, delete (or not) notifications about the post
|
||||
if matches!(new_visibility, PostVisibilityLevel::VISIBILITY_USER) {
|
||||
notifications_helper::delete_all_related_with_post(post.id)?;
|
||||
}
|
||||
|
||||
r.success("Visibility level updated")
|
||||
}
|
||||
|
Reference in New Issue
Block a user