X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapi_crud%2Fsrc%2Fcomment%2Fremove.rs;h=c18a8c5b7486f24ce217435cbf8cc732781c5941;hb=f7f6766650b9b573a72075e564aed353c0131cd7;hp=2bb5c75f2f9b9fdf12de3b6ee9f105254eb0eb2a;hpb=ae438e148e3d0365a80ea8a9a40a3d3e9c0aad60;p=lemmy.git diff --git a/crates/api_crud/src/comment/remove.rs b/crates/api_crud/src/comment/remove.rs index 2bb5c75f..c18a8c5b 100644 --- a/crates/api_crud/src/comment/remove.rs +++ b/crates/api_crud/src/comment/remove.rs @@ -10,10 +10,11 @@ use lemmy_api_common::{ use lemmy_db_schema::{ source::{ comment::{Comment, CommentUpdateForm}, + comment_report::CommentReport, moderator::{ModRemoveComment, ModRemoveCommentForm}, post::Post, }, - traits::Crud, + traits::{Crud, Reportable}, }; use lemmy_db_views::structs::CommentView; use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType}; @@ -56,6 +57,9 @@ pub async fn remove_comment( .await .with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?; + CommentReport::resolve_all_for_object(&mut context.pool(), comment_id, local_user_view.person.id) + .await?; + // Mod tables let form = ModRemoveCommentForm { mod_person_id: local_user_view.person.id,