]> Untitled Git - lemmy.git/blobdiff - crates/db_queries/src/source/comment_report.rs
Clean up reporting (#1776)
[lemmy.git] / crates / db_queries / src / source / comment_report.rs
index 738ec3e299436c2ab990e6011b6af58096780c99..10b9d43e8a83d604094c43cbcf58e88a618cbe8a 100644 (file)
@@ -3,11 +3,13 @@ use diesel::{dsl::*, result::Error, *};
 use lemmy_db_schema::{
   naive_now,
   source::comment_report::{CommentReport, CommentReportForm},
+  CommentReportId,
   PersonId,
 };
 
 impl Reportable for CommentReport {
   type Form = CommentReportForm;
+  type IdType = CommentReportId;
   /// creates a comment report and returns it
   ///
   /// * `conn` - the postgres connection
@@ -26,7 +28,7 @@ impl Reportable for CommentReport {
   /// * `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::comment_report::dsl::*;
@@ -46,7 +48,7 @@ impl Reportable for CommentReport {
   /// * `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::comment_report::dsl::*;