]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/traits.rs
Automatically resolve report when post/comment is removed (#3850)
[lemmy.git] / crates / db_schema / src / traits.rs
index 07f0b07e25937c1481a6a2c879f6a3a70cdee036..cb128339b19f16adc33b001f7f0fb1f7f325c5f1 100644 (file)
@@ -155,6 +155,7 @@ pub trait Readable {
 pub trait Reportable {
   type Form;
   type IdType;
+  type ObjectIdType;
   async fn report(pool: &mut DbPool<'_>, form: &Self::Form) -> Result<Self, Error>
   where
     Self: Sized;
@@ -163,6 +164,13 @@ pub trait Reportable {
     report_id: Self::IdType,
     resolver_id: PersonId,
   ) -> Result<usize, Error>
+  where
+    Self: Sized;
+  async fn resolve_all_for_object(
+    pool: &mut DbPool<'_>,
+    comment_id_: Self::ObjectIdType,
+    by_resolver_id: PersonId,
+  ) -> Result<usize, Error>
   where
     Self: Sized;
   async fn unresolve(