]> Untitled Git - lemmy.git/blobdiff - crates/db_queries/src/source/post_report.rs
Clean up reporting (#1776)
[lemmy.git] / crates / db_queries / src / source / post_report.rs
index 19cd5dfea7f9b2a46fabefe80b17da73a35b9849..e787fed4c385e6339c056a22ccf32f1520e67dc2 100644 (file)
@@ -1,9 +1,11 @@
 use crate::Reportable;
 use diesel::{dsl::*, result::Error, *};
-use lemmy_db_schema::{naive_now, source::post_report::*, PersonId};
+use lemmy_db_schema::{naive_now, source::post_report::*, PersonId, PostReportId};
 
 impl Reportable for PostReport {
   type Form = PostReportForm;
+  type IdType = PostReportId;
+
   /// creates a post report and returns it
   ///
   /// * `conn` - the postgres connection
@@ -22,7 +24,7 @@ impl Reportable for PostReport {
   /// * `by_resolver_id` - the id of the user resolving the report
   fn resolve(
     conn: &PgConnection,
-    report_id: i32,
+    report_id: Self::IdType,
     by_resolver_id: PersonId,
   ) -> Result<usize, Error> {
     use lemmy_db_schema::schema::post_report::dsl::*;
@@ -42,7 +44,7 @@ impl Reportable for PostReport {
   /// * `by_resolver_id` - the id of the user unresolving the report
   fn unresolve(
     conn: &PgConnection,
-    report_id: i32,
+    report_id: Self::IdType,
     by_resolver_id: PersonId,
   ) -> Result<usize, Error> {
     use lemmy_db_schema::schema::post_report::dsl::*;