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
/// * `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::*;
/// * `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::*;