1
0
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:
2021-01-25 18:46:14 +01:00
parent 608a85e7f5
commit c510e6abce
2 changed files with 6 additions and 3 deletions

View File

@ -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")
}